-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating the linter #364
Comments
Probably we need a strong DETEKT rules here |
Relevant issue: pinterest/ktlint#2675 (for accepting |
After that PR is merged, the linter can be updated relatively easily.
|
I've been tweaking some settings in .editorconfig to what I think looks best (and most in-line with DataFrame): We just need to figure out how to NOT run on generated-sources by default (as it's way to heavy) but allow the linter to format generated-sources from github actions instead. |
Some updates: I've had difficulties using Kotlinter due to its limited customization options. After trying Spotless, which also wasn't fit for the job, I found https://github.com/JLLeitschuh/ktlint-gradle, which is also used by kotlin-jupyer. This branch contains a working project with that plugin: https://github.com/Kotlin/dataframe/tree/k2-ktlint-jlleitschuh-attempt. In principle, it works the same as Kotlinter; it takes the .editorconfig file as source of truth, but, if we need it, we can programmatically override certain rules. It's ktlint-version independent. It can auto-check and -format when needed and it creates tasks for each individual source set. Since the generated-sources are no sourceSet, it will not run on them by default, which is great :) We can still create a custom ktlint format task for the generated sources though, as I did in If people want, they can run Finally, the plugin has baseline support https://github.com/JLLeitschuh/ktlint-gradle?tab=readme-ov-file#baseline-support. This means, in theory, we can make the linter only format files that are touched. While this would lower the impact of enabling the new linter, I feel an opportunity to clean up the library like this will not come around soun again. |
The linter plugin we use (https://github.com/jeremymailen/kotlinter-gradle) can be updated to v3.14.0.
However, two things:
The text was updated successfully, but these errors were encountered: