-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add basic .editorconfig file to help maintain consistent coding styles
#7562
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
base: 4.22
Are you sure you want to change the base?
Conversation
|
@jbampton I like the idea but would like to not enforce people installing something. I think style would be best set in a pre-commit hook. is that possible with this tool? |
|
also, (i had a look at some examples) your config is not tuned to the project yet. some file types are more equal than others. |
|
let's move to 4.20 |
|
@blueorangutan package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a basic .editorconfig to enforce consistent file encoding, line endings, and final newline.
- Introduces a root-level EditorConfig file with license header
- Defines default charset, end_of_line, and insert_final_newline settings
- Includes commented examples for indent and line length options
|
@jbampton , is this still relevant? |
|
We should use an EditorConfig file. A lot of top projects use it: https://github.com/editorconfig/editorconfig/wiki/Projects-Using-EditorConfig I am not sure if we are ready to set the config and apply it to all files etc. It could possibly cause formatting changes to be mixed up with features in other peoples PRs since IDEs normally just auto format files based on the EditorConfig settings. Normally we need to also set the indent_style and indent_size for all files overall or for each type. I think some of the Python code is currently using mixed indentation last I checked. I have some other PRs in play and I was working on code standardization with pre-commit. We have some other issues as seen in #12246 |
|
@jbampton I don’t mind this. Does it need more work? cc @vishesh92 @sureshanaparti et al. |
Co-authored-by: dahn <daan.hoogland@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.22 #7562 +/- ##
=========================================
Coverage 17.58% 17.58%
- Complexity 15580 15582 +2
=========================================
Files 5910 5910
Lines 529439 529439
Branches 64691 64691
=========================================
+ Hits 93093 93116 +23
+ Misses 425861 425837 -24
- Partials 10485 10486 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
This PR adds a simple
EditorConfigfile. I used only three settings to start with.Lots of great projects already use EditorConfig:
https://github.com/editorconfig/editorconfig/wiki/Projects-Using-EditorConfig
And you can see how Apache Airflow does it:
https://github.com/apache/airflow/blob/main/.editorconfig
From the official site:
"EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs. The EditorConfig project consists of a file format for defining coding styles and a collection of text editor plugins that enable editors to read the file format and adhere to defined styles. EditorConfig files are easily readable and they work nicely with version control systems."
https://editorconfig.org/
A lot of editors already come bundled with support: https://editorconfig.org/#pre-installed
Some editors require you to download a plugin: https://editorconfig.org/#download
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?