Skip to content

Add .editorconfig #172

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

Merged
merged 1 commit into from
Mar 10, 2021
Merged

Add .editorconfig #172

merged 1 commit into from
Mar 10, 2021

Conversation

prusnak
Copy link
Contributor

@prusnak prusnak commented Mar 7, 2021

This PR adds an EditorConfig config file which might consolidates whitespace usage eventually across the project:

  • remove trailing whitespace
  • insert final new-line
  • end-of-line is LF
  • charset is UTF-8

I didn't change any files afterall, because this would lead to lots of merge conflicts. But if contributors' editor supports this, they will create consistent files.

@GBKS GBKS requested a review from ConorOkus March 8, 2021 09:20
@prusnak prusnak changed the title Add .editorconfig and consolidate whitespace usage Add .editorconfig Mar 8, 2021
This might consolidate whitespace usage across the project eventually.
@ConorOkus
Copy link
Collaborator

Hi @prusnak ,

I think having something like this in the project would be very nice.

Can you explain how we would enforce this though? Does it get run at build time?

From what I understand an editor like visual code has a plugin that supports this which ensures the file is formatted on every save but not sure how it works in other editors.

What does it look like over the longer term, would we need to define formatting per file type? I see the rules you have put in by default just cover mainly spacing.

Does it make sense to have something with stronger linting? e.g http://www.plainionist.net/Plainion.JekyllLint/

@prusnak
Copy link
Contributor Author

prusnak commented Mar 8, 2021

From what I understand an editor like visual code has a plugin that supports this which ensures the file is formatted on every save but not sure how it works in other editors.

There are lots of editors that support this out of the box - see https://editorconfig.org/#pre-installed

Another bunch of editors require a plugin - https://editorconfig.org/#download

This is not enforced anywhere (yet), because this would make lots of people unhappy (failing CI, etc). But when an user with editor respecting the file saves the file, the settings will be applied.

@prusnak
Copy link
Contributor Author

prusnak commented Mar 8, 2021

Does it make sense to have something with stronger linting? e.g http://www.plainionist.net/Plainion.JekyllLint/

You can surely apply linters for markdown, html, etc. But this is out of scope of this PR.

@GBKS GBKS merged commit c49d7af into BitcoinDesign:master Mar 10, 2021
@prusnak prusnak deleted the editorconfig branch March 10, 2021 11:25
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.

None yet

4 participants