CQ: Add .editorconfig and validate repo against it#4792
Draft
echoix wants to merge 21 commits intoOSGeo:mainfrom
Draft
CQ: Add .editorconfig and validate repo against it#4792echoix wants to merge 21 commits intoOSGeo:mainfrom
echoix wants to merge 21 commits intoOSGeo:mainfrom
Conversation
Member
Author
|
Theres 7 bat files to change line endings too |
3ea0708 to
ba1d323
Compare
a9c81e7 to
025c29b
Compare
5e4269f to
6680322
Compare
Merged
echoix
added a commit
that referenced
this pull request
Jul 17, 2025
…6070) Simplified and adapted from #4792. Fixes #6066 (comment) The action that checks for CRLF has been failing since at least this weekend. Considering that that action has low chances of beeing fixed in a timely matter, I replaced the functionality with an .editorconfig file and validating against it with editorconfig-checker. Compared to #4792, here I don’t attempt to make the line ending changes persist in the repo through .gitattributes, and ignore a bit more of non-ready config sections (since the functionality replaced was less detailed than what the .editorconfig I already had almost working). I made the pre-commit run always, and made it faster in consequence to not add a big impact. With hot cache, it is taking 1min-1min10, which is about the same. I knew pre-commit could be faster in CI as I already saw how fast it was in ruff’s own CI when submitting one of my PRs there once. It can still be a bit faster, but it’s enough for today. * CQ: Add initial .editorconfig file with basic settings * CI: Add EditorConfig validation to super-linter workflow * CI: Remove CRLF check from additional_checks.yml workflow * CQ: Add editorconfig-checker to pre-commit config * CI: Always run pre-commit in CI * Update .editorconfig with new whitespace settings for mswindows * CI: Run pre-commit step with uvx * CI: Add caching for pre-commit checks in workflow * Update .editorconfig for Windows batch files * CI: Remove paths-filter step from additional_checks.yml * Update additional_checks.yml step setup-uv
Member
|
@echoix Anything still useful here? |
Member
Author
I’ll have to refresh it and take a new look, not now. I’m not sure of how I want pre-commit checks to work on Windows. And how the transition of contributor’s already checked out repos, how to validate that it’ll work as expected and what to document. I’ll probably end up extracting working pieces out of it instead. |
echoix
added a commit
to echoix/grass
that referenced
this pull request
Sep 21, 2025
…SGeo#6070) Simplified and adapted from OSGeo#4792. Fixes OSGeo#6066 (comment) The action that checks for CRLF has been failing since at least this weekend. Considering that that action has low chances of beeing fixed in a timely matter, I replaced the functionality with an .editorconfig file and validating against it with editorconfig-checker. Compared to OSGeo#4792, here I don’t attempt to make the line ending changes persist in the repo through .gitattributes, and ignore a bit more of non-ready config sections (since the functionality replaced was less detailed than what the .editorconfig I already had almost working). I made the pre-commit run always, and made it faster in consequence to not add a big impact. With hot cache, it is taking 1min-1min10, which is about the same. I knew pre-commit could be faster in CI as I already saw how fast it was in ruff’s own CI when submitting one of my PRs there once. It can still be a bit faster, but it’s enough for today. * CQ: Add initial .editorconfig file with basic settings * CI: Add EditorConfig validation to super-linter workflow * CI: Remove CRLF check from additional_checks.yml workflow * CQ: Add editorconfig-checker to pre-commit config * CI: Always run pre-commit in CI * Update .editorconfig with new whitespace settings for mswindows * CI: Run pre-commit step with uvx * CI: Add caching for pre-commit checks in workflow * Update .editorconfig for Windows batch files * CI: Remove paths-filter step from additional_checks.yml * Update additional_checks.yml step setup-uv
echoix
added a commit
to echoix/grass
that referenced
this pull request
Sep 25, 2025
…SGeo#6070) Simplified and adapted from OSGeo#4792. Fixes OSGeo#6066 (comment) The action that checks for CRLF has been failing since at least this weekend. Considering that that action has low chances of beeing fixed in a timely matter, I replaced the functionality with an .editorconfig file and validating against it with editorconfig-checker. Compared to OSGeo#4792, here I don’t attempt to make the line ending changes persist in the repo through .gitattributes, and ignore a bit more of non-ready config sections (since the functionality replaced was less detailed than what the .editorconfig I already had almost working). I made the pre-commit run always, and made it faster in consequence to not add a big impact. With hot cache, it is taking 1min-1min10, which is about the same. I knew pre-commit could be faster in CI as I already saw how fast it was in ruff’s own CI when submitting one of my PRs there once. It can still be a bit faster, but it’s enough for today. * CQ: Add initial .editorconfig file with basic settings * CI: Add EditorConfig validation to super-linter workflow * CI: Remove CRLF check from additional_checks.yml workflow * CQ: Add editorconfig-checker to pre-commit config * CI: Always run pre-commit in CI * Update .editorconfig with new whitespace settings for mswindows * CI: Run pre-commit step with uvx * CI: Add caching for pre-commit checks in workflow * Update .editorconfig for Windows batch files * CI: Remove paths-filter step from additional_checks.yml * Update additional_checks.yml step setup-uv
echoix
added a commit
that referenced
this pull request
Sep 25, 2025
…6070) Simplified and adapted from #4792. Fixes #6066 (comment) The action that checks for CRLF has been failing since at least this weekend. Considering that that action has low chances of beeing fixed in a timely matter, I replaced the functionality with an .editorconfig file and validating against it with editorconfig-checker. Compared to #4792, here I don’t attempt to make the line ending changes persist in the repo through .gitattributes, and ignore a bit more of non-ready config sections (since the functionality replaced was less detailed than what the .editorconfig I already had almost working). I made the pre-commit run always, and made it faster in consequence to not add a big impact. With hot cache, it is taking 1min-1min10, which is about the same. I knew pre-commit could be faster in CI as I already saw how fast it was in ruff’s own CI when submitting one of my PRs there once. It can still be a bit faster, but it’s enough for today. * CQ: Add initial .editorconfig file with basic settings * CI: Add EditorConfig validation to super-linter workflow * CI: Remove CRLF check from additional_checks.yml workflow * CQ: Add editorconfig-checker to pre-commit config * CI: Always run pre-commit in CI * Update .editorconfig with new whitespace settings for mswindows * CI: Run pre-commit step with uvx * CI: Add caching for pre-commit checks in workflow * Update .editorconfig for Windows batch files * CI: Remove paths-filter step from additional_checks.yml * Update additional_checks.yml step setup-uv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To be rebased after #4790 and #4791, to drop repeated commits. This is intended to be a draft, and would like to separate the change of line endings stored to CRLF for some files (plus the .gitattributes file change) to be in another commit, easier to cherry-pick afterwards.
With an .editorconfig file, most editors will adjust some preferences to match these settings. For example, setting to trim lines on some file types will have the whitespace trimmed when saving the file, preventing the situation where I regularly need to remove some files that slept through, as we had no CI to enforce it. Setting whether spaces or tabs are used, the indent size, whether to always ensure a new line is present on save. Plugins can accept more domain-specific settings, but appart from the couple of basic properties that are supported by all implementations, the rest is more like a preference if the plugins support the custom properies. For example, Intellij (Pycharm) uses many keys supported only by them, and in CSharp+Visual Basic, editorconfig files are used to select ALL the formatting choices and enable/silence/change the severity of some warnings, supported with more than just the Visual Studio IDE.
This PR: