-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add editorconfig file and cleanup devicon.json
bad formatting
#1364
Conversation
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.
@Snailedlt did you get time to check? |
I'll be merging this PR soon. Thank you for your patience. |
Sorry I didn't get to check it. |
@Snailedlt |
New Version of PR #1344 (recreated since rebase created too much conflicts)
Intro
This PR is based on this discussion #1337 , the idea was, as a first step, to add EditorConfig to the project, and I also fix bad formatting on the JSON file.
What is EditorConfig ?
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.
What is done by EditorConfig
When you work on a file, and for example press the tab key , you will automatically insert the correct indent type and length, for Devicon it's
space of length 4
.When you save the file, the
charset
defined will be used, whitespace at end of lines (if enable) will be removed. An empty new line will be created at the end of the file if not already present.What isn't done
EditorConfig is not a linter, so the file won't be re-ordered, existing
tab
keys won't be replaced by spaces, or miss-aligned indentation won't be fixed.EditorConfig is a list of parameters what will be read and used by your current IDE to format the text you are adding, and format the ouput file settings (
charset
,insert_final_newline
).Conclusion
EditorConfig is one step in the right direction to unified project files formatting
This does not replace a linter, for JSON file spectral could be a good choice.
Github Hook can be added to lint the JSON file:
https://meta.stoplight.io/docs/spectral/ecaa0fd8a950d-workflows#git-hooks
Since the "cleaning" of
devicon.json
file can lead to merge conflicts It's maybe a good idea to handle the open pull requests first, then when there is few pull requests still open, this PR can be merge to develop.