integreat-cms
integreat-cms copied to clipboard
Configure ruff import sorting and drop isort support
Short description
This pull request enables import sorting for ruff and tick some of the remaining boxes in #2442.
Side effects
While Ruff claims to be nearly equivalent to Isort when profile = "black", it formats the imports slightly differently. This pull request removes support for isort and deprecates black in our documentation to address the conflicting formatters.
Further Information: https://docs.astral.sh/ruff/faq/#how-does-ruffs-import-sorting-compare-to-isort
Code Climate has analyzed commit 64ebd9dc and detected 0 issues on this pull request.
The test coverage on the diff in this pull request is 100.0% (50% is the threshold).
This pull request will bring the total coverage in the repository to 82.3% (0.0% change).
View more on Code Climate.
I don't think tracking .vscode/ is a good idea. Could we do something like putting it into example-configs/ or otherwise renaming it but have it still feel intuitive (so you don't set up your whole project and notice at the very end that you could have based it on the default config)?
Hey @PeterNerlich, I don't see any negative consequences in configuring the formatter and linter properly right away. When utilized, it ensures a consistent code style, which might not adhere to the default code settings, but the CI will ultimately ensure our code style anyway. Why do you think it's better not to change the default settings?
Hm, I'm with @PeterNerlich on this. Not sure we should be adding editor-specific configs. Wouldn't most people have set this up globally in their editor already anyways (and if not, probably prefer it that way)?
My concern was mostly about some user changing settings and then accidentally committing them to the project. This wouldn't happen if the config in the repo was under some other name (like vscode.example/) that you'd copy to .vscode in order to use and maybe customize further – any changes to the example would have to be deliberate by design (except if you use symlinks, but then that's your own fault)
I think it's unlikely for someone to change the file by accident because changes made in Visual Studio Code are not written to the settings.json. I agree with you that it feels weird to commit dotfiles, but in this case, it adds value to the developer experience and onboarding. Let me know if I've overlooked any cases where having the file would be problematic. 🙈
I have an idea for a tradeoff. How about removing it from here and adding it to the devcontainer configuration, as it already contains some ruff related stuff? @PeterNerlich @charludo
I have an idea for a tradeoff. How about removing it from here and adding it to the devcontainer configuration, as it already contains some rough-related stuff? @PeterNerlich @charludo
Sounds like a good idea to me!!
Are you recommending the use of Ruff extension for Visual Studio Code?
- https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff
Are you recommending the use of Ruff extension for Visual Studio Code?
- https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff
@cclauss yep it is predefined in our setup for code users