- Notifications
You must be signed in to change notification settings - Fork108
Closed
Description
Picture the following scenario:
- I run an open source project
- My project has a
.editorconfig
file - My project has continuous integration tests onTravis CI (or similar)
- The tests are run every time somebody submits a pull request to my project (and on every commit)
When contributors submit pull requests to my project, I'd like to check all changed files against the rules defined in.editorconfig
. (This would be a kind of "sanity check" before the main tests are run.)
- I want the CI test to fail if somebody submits code that violates the rules in
.editorconfig
. - The test will print a list of files that failed, and why each file failed.
- The test would inform contributors that they can visithttps://editorconfig.org/ for instructions on how to setup their preferred editor/IDE so that their code will pass the test automatically.
Example output of test program:
./editorconfig-sanity-check: checking code files against rules in .editorconfigREADME.md - Line 17 - trailing whitespace detected (trim_trailing_whitespace = TRUE)docs/index.html - Line 4 - character 33 is invalid (charset = UTF-8)src/module.py - Line 62 - indentation TAB detected (indent_style = SPACE)src/module.py - Line 62 - wrong indent_size detected (indent_size = 4)platform/script.sh - Line 28 - missing final newline (insert_final_newline = true)platform/script.bat - Line 1 - wrong line ending detected (end_of_line = CRLF)For instructions on how to setup your editor/IDE to avoid making these errorsin the future, please see <https://editorconfig.org/>.
As you can see, providing this feature is a win for both maintainers and contributors, and provides a lot of free publicity for EditorConfig!
Metadata
Metadata
Assignees
Labels
No labels