-
Notifications
You must be signed in to change notification settings - Fork 5
Use editorconfig here and autopatch apps projects #41
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: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # EditorConfig: https://editorconfig.org | ||
|
|
||
| # top-most EditorConfig file | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| indent_size = 4 | ||
| indent_style = space | ||
| insert_final_newline = true | ||
| spelling_language = en-US | ||
| # Let's also remove trailing whitespaces, even in markdown: | ||
| # https://www.markdownguide.org/basic-syntax/#line-breaks | ||
| trim_trailing_whitespace = true | ||
|
|
||
| [**_fr.md] | ||
| spelling_language = fr | ||
|
|
||
| [**.yml] | ||
| indent_size = 2 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -eEu -o pipefail | ||
|
|
||
| if [ -f .editorconfig ]; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| cat <<EOF >> ./.editorconfig | ||
| # EditorConfig: https://editorconfig.org | ||
|
|
||
| # top-most EditorConfig file | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| indent_size = 4 | ||
| indent_style = space | ||
| insert_final_newline = true | ||
| spelling_language = en-US | ||
| # Let's also remove trailing whitespaces, even in markdown: | ||
| # https://www.markdownguide.org/basic-syntax/#line-breaks | ||
| trim_trailing_whitespace = true | ||
|
|
||
| [**_fr.md] | ||
| spelling_language = fr | ||
| EOF | ||
|
|
||
| git add .editorconfig |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| EditorConfig is a widely supported specification to help maintain consistent coding styles: | ||
| https://editorconfig.org/#overview | ||
|
|
||
| It is meant to help the developer follow a unique code style for a few issues: | ||
|
|
||
| - the indentation (4-spaces suggested here); | ||
| - the encoding (utf-8 suggested); | ||
| - remove trailing whitespaces; | ||
| - ... | ||
|
|
||
| As a developer, you should check whether your editor [has native support](https://editorconfig.org/#pre-installed) or if it [requires a plugin](https://editorconfig.org/#download). | ||
|
|
||
| Feel free to customize it or to close the PR if you don't like it. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add .editorconfig file to project |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,17 @@ | ||
| location /github { | ||
|
|
||
| # Force usage of https | ||
| if ($scheme = http) { | ||
| rewrite ^ https://$server_name$request_uri? permanent; | ||
| } | ||
| # Force usage of https | ||
| if ($scheme = http) { | ||
| rewrite ^ https://$server_name$request_uri? permanent; | ||
| } | ||
|
|
||
| client_max_body_size 100M; | ||
| client_max_body_size 100M; | ||
|
|
||
| proxy_pass http://127.0.0.1:8123; | ||
| proxy_http_version 1.1; | ||
| proxy_set_header Upgrade $http_upgrade; | ||
| proxy_set_header Connection "Upgrade"; | ||
| proxy_pass http://127.0.0.1:8123; | ||
| proxy_http_version 1.1; | ||
| proxy_set_header Upgrade $http_upgrade; | ||
| proxy_set_header Connection "Upgrade"; | ||
|
|
||
| # preserve client IP | ||
| proxy_set_header X-Forwarded-For $remote_addr; | ||
| # preserve client IP | ||
| proxy_set_header X-Forwarded-For $remote_addr; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here is the tricky part. nginx conf files seem to have 2-space indentation code style. I don't know what to do with that: should it remain consistent with the rest of the files (4-spaces indentation) or should it be an exception (2-spaces)?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In most of my apps I have 4 space indentation in nginx config so I suppose the nginx config indentation seem not really consistant. From my point of view we can make this consistent with the rest with 4 space and we can fix the place where it's not the case. But we might need the point of view from other packager.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The less exceptions there are, the better for me. So OK for 4-space indentations in Nginx. |
||
| } | ||
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.
I found that yaml looks 2-spaces idented here. I follow what exists.