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

config: update .editorconfig parameters according to current format of files #6696

Merged
merged 14 commits into from
Mar 16, 2022

Conversation

davorpa
Copy link
Member

@davorpa davorpa commented Feb 5, 2022

What does this PR do?

Improve repo

For resources

Description

Update .editorconfig parameters according to values provided by @SethFalco in #5564 (commit e9f7dff) and extend it.

  • 2 spaces indent for yaml or yml files
  • 2 spaces indent for json & jsonc (commented) files
  • avoid strip trailing spaces in any kind of markdown files

Moreabout editorconfig syntax at: https://editorconfig.org/

Checklist:

Follow-up

  • Check the status of GitHub Actions and resolve any reported warnings!

@davorpa davorpa self-assigned this Feb 5, 2022
@davorpa davorpa marked this pull request as ready for review February 5, 2022 21:37
@davorpa davorpa added the 👀 Needs Review Is this really a good resource? Reviews requested. label Feb 5, 2022
@davorpa davorpa requested a review from a team February 5, 2022 21:48
@davorpa davorpa requested review from a team and removed request for a team February 6, 2022 06:52
Copy link
Member

@LuigiImVector LuigiImVector left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you use ; for the rule comments and # for the file description? And why did you include the python, bat, powershell files if they are not used?

@davorpa
Copy link
Member Author

davorpa commented Feb 6, 2022

Why did you use ; for the rule comments and # for the file description?

According documentation comments can be addressed by # or ; without side effects: https://editorconfig-specification.readthedocs.io/#file-format

So to differentiate, I've preferred to use ; for section/heading comments and # for general or header ones.

And why did you include the python, bat, powershell files if they are not used?

Sorry, I have some scripts in my local environment testing things with nodejs and remark. Let's decide if revert fd9a837, 5516f58, 20bac81, 4b2c37b commits is needed.

Its parametrization is taken from known examples provided in: https://github.com/editorconfig/editorconfig/wiki/Projects-Using-EditorConfig

Moreover... I update the link pointing to this repo in that wiki 😜

@LuigiImVector
Copy link
Member

Sorry, I have some scripts in my local environment testing things with nodejs and remark. Let's decide if revert fd9a837, 5516f58, 20bac81, 4b2c37b commits is needed.

I think they need to be deleted to have a cleaner code, maybe wait for a review from someone more experienced

@SethFalco
Copy link
Sponsor Member

SethFalco commented Feb 6, 2022

I just use the same EditorConfig file in all my projects, regardless of the contents of the repository. (This One)
I don't see the harm in including the extra, especially since when or if a batch file were to be added, said person probably wouldn't update the EditorConfig after. On the other hand, it does seem a bit cluttered tbh.

The above is an opinion, and nothing more.


However, I think most if not all the comments should be entirely removed. (EditorConfig is very self-explanatory as it is.)

; JSON files - compress a little more
[*.{json,jsonc}]
indent_size = 2

And the comments aren't necessarily accurate either. "Compress" compared to what?
Coding conventions shouldn't be commented with an action, since that action may not apply to how everyone writes JSON.

In other words, the EditorConfig describes how the code should look to editors.
In this case, if it compresses or inflates the JSON file depends entirely on if the developer normally does 1 space, or 4 spaces.

@SethFalco
Copy link
Sponsor Member

SethFalco commented Feb 6, 2022

I do also wonder where all the file extensions came from, for example Markdown.

; Markdown files - preserve whitespaces
[*.{md,mkd,mkdn,mdwn,mdown,markdown}]
trim_trailing_whitespace = false

On Wikipedia:

.md, .markdown

https://en.wikipedia.org/wiki/Markdown

This is also another case where the comment seems a bit redundant. ^-^'
It only has 1 rule, which is to not trim trailing whitespace. We can tell it's for preserving the whitespace.

Edit: Just realized the file extensions were linked, fair enough. Does still seem cluttered to have them all through in the repository. Just *.md would be enough. (Since in we'd probably end up enforcing the use of that file extension anyway.)

@davorpa
Copy link
Member Author

davorpa commented Feb 6, 2022

Thanks for the starter template. Adopted a bit.

Comments are in part for my future self (I have a fish memory sometimes)

Better now after 520d0e9 or completely remove not used?

@LuigiImVector
Copy link
Member

Better now after 520d0e9 or completely remove not used?

Comments are better now even if i think you can remove the unused ones

@davorpa davorpa added the 🐛 BUG Confirmed bugs, normally at GitHub Pages label Feb 12, 2022
@davorpa
Copy link
Member Author

davorpa commented Feb 22, 2022

What more I need to go ahead with the PR?

@davorpa davorpa added the question Needs clarification by involved users / reviewers label Feb 22, 2022
@LuigiImVector
Copy link
Member

LuigiImVector commented Feb 22, 2022

What more I need to go ahead with the PR?

I think the only problems are the "excess" of information it contains: comments and (not yet) used extensions.

Comments can be left as they are in my opinion, for the extensions (ps1, js, ts...) I find that they are currently useless but could be used in the future, if no one opposes PR can be merged.

- simplify properties already defined in global section
- remove not used future patterns
@davorpa
Copy link
Member Author

davorpa commented Feb 25, 2022

I clean it a bit more.

@LuigiImVector
Copy link
Member

LGTM

@davorpa davorpa removed question Needs clarification by involved users / reviewers 🐛 BUG Confirmed bugs, normally at GitHub Pages labels Feb 26, 2022
@davorpa davorpa requested a review from eshellman March 16, 2022 19:13
@eshellman eshellman merged commit b5821e1 into EbookFoundation:main Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 Needs Review Is this really a good resource? Reviews requested.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants