Skip to content
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 for setting coding style #770

Merged
merged 1 commit into from
Feb 8, 2021

Conversation

poll-busily
Copy link
Contributor

@poll-busily poll-busily commented Dec 23, 2020

While cleaning up my last PR I realised that I had to set some editor style settings. In previous projects I've used an editorconfig file to automate this.

Editorconfig is a standard that helps set editor settings automatically to support the project's coding style. It's not related to linting or auto-formatting directly, focusing instead on setting the style for newly-written or modified code.

Supported editors will pick up and apply these settings for the Cloudlog source directory, not interfering with other project folders or user settings in other locations.

This config specifies UTF-8 encoding and LF line-endings for all project files, tabbed indentation for source and data files and, finally, trailing newlines and whitespace trimming just for source files. These rules are based on what I saw in https://github.com/magicbug/Cloudlog/wiki/Development-Notes and from the dominant formatting options in the existing source files. All open to changes, of course, which is why this is a draft PR.

If an editor is set up to perform reformatting of code automatically (e.g. on save or on paste) then these rules will influence that behaviour, but applying them won't cause an editor to reformat existing code en-masse.

@poll-busily poll-busily marked this pull request as ready for review December 26, 2020 12:16
@poll-busily poll-busily changed the title Draft: Add editorconfig file for setting coding style [Dev] Add editorconfig file for setting coding style Dec 28, 2020
@daccle
Copy link
Contributor

daccle commented Jan 12, 2021

I like this to be added.

@poll-busily poll-busily changed the title [Dev] Add editorconfig file for setting coding style Add editorconfig file for setting coding style Jan 28, 2021
Editorconfig is a standard, supported by many popular editing tools, that helps set required editor settings automatically to support the project's coding style. It's not a linter / auto-formatter, it just sets a few basic options. Supported editors will pick up these settings specifically for the cloudlog source directory, not interfering with project or user settings in other locations.

This config specifies UTF-8 encoding and LF line-endings for all project files, tabbed indentation for source and data files and finally final newlines and whitespace trimming just for source files. These are based on what I saw in https://github.com/magicbug/Cloudlog/wiki/Development-Notes and from the dominant formatting options in the existing source files. All open to changes, of course.

If an editor is set up to perform reformatting of code automatically (e.g. on save or on paste) then these rules will influence that behaviour, but they will not cause an editor to reformat existing code on their own.
@poll-busily
Copy link
Contributor Author

Got a few thumbs up on this so far. What are your thoughts, @magicbug? Is it okay to go in?

@AndreasK79
Copy link
Contributor

I would like this as well.

@magicbug
Copy link
Owner

magicbug commented Feb 8, 2021

I'm OK for it to go in, sorry for the delay, been rough few weeks

@magicbug magicbug merged commit db9aca6 into magicbug:master Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants