Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .editorconfig
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
Copy link
Contributor Author

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.

2 changes: 1 addition & 1 deletion autopatches/patches/add-cpe/pr_body.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ This is an ***automated*** patch to add the (optional but recommended if relevan

In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps.

The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number)").
The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number)").
30 changes: 30 additions & 0 deletions autopatches/patches/editorconfig/patch
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
13 changes: 13 additions & 0 deletions autopatches/patches/editorconfig/pr_body.md
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.
1 change: 1 addition & 0 deletions autopatches/patches/editorconfig/pr_title.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add .editorconfig file to project
2 changes: 1 addition & 1 deletion readme_generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ echo "the_bot_token" > token
Add the webhook.service to systemd config, then start it:

```bash
systemctl start the_webhook_service
systemctl start the_webhook_service
```
22 changes: 11 additions & 11 deletions readme_generator/nginx.conf
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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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)?

Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

}