Skip to content

Commit b648cd3

Browse files
committed
Add chapter on automatic checks in Contributing
1 parent ea41cc9 commit b648cd3

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Contributing.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ New scripts are added with pull requests against master branch of this repositor
3232
- make your Python script compatible with Python 3.x, the support of Python 2.x is now optional
3333
- use the official WeeChat URL: [https://weechat.org](https://weechat.org) (`https` and no `www.`) in any link to the WeeChat website.
3434

35+
Your script is automatically checked in CI, see [Automatic checks on scripts](#automatic-checks-on-scripts).
36+
3537
## Updating a script
3638

3739
### Contacting the author
@@ -60,6 +62,8 @@ Scripts updates are made with pull requests against master branch of this reposi
6062
- do **NOT** update the author name in script (used in `register` function), it must always contain the original script author, even if you are doing large updates in the script
6163
- make any Python script compatible with Python 3.x, the support of Python 2.x is now optional.
6264

65+
The script is automatically checked in CI, see [Automatic checks on scripts](#automatic-checks-on-scripts).
66+
6367
## Deleting a script
6468

6569
Deleting a script must be done for a justified decision, for example such reasons are valid:
@@ -76,3 +80,28 @@ If you are not the author of the script, you must first contact the author to di
7680
- fill the pull request template
7781
- make only one commit to delete only one script
7882
- use this commit message: `Remove script name.py`, and it is recommended to explain the reasons in the commit description
83+
84+
## Automatic checks on scripts
85+
86+
Whenever a script is added or updated, the script [check_scripts.py](tools/check_scripts.py) is executed by CI in GitHub Actions and looks for errors in the script.
87+
88+
The following checks are performed (only errors are fatal for the CI job):
89+
90+
- errors:
91+
- the author e-mail is missing
92+
- missing call to `infolist_free` (when `infolist_get` is called)
93+
- the info `python2_bin` is used: it is deprecated and must not be used any more (Python script only)
94+
- warnings:
95+
- the function `sys.exit()` is called: this causes WeeChat itself to exit (Python script only)
96+
- info:
97+
- the first line of the script is a shebang: it's not needed
98+
- the WeeChat URL is not exactly `https://weechat.org`
99+
100+
If errors are detected in the script, you must fix them before the script is manually tested/merged by the WeeChat team.
101+
102+
It is recommended to run yourself this script prior to submit the pull request.\
103+
For example if your script is called `name.py`, you can check it with this command:
104+
105+
```
106+
$ /path/to/scripts/tools/check_scripts.py name.py
107+
```

0 commit comments

Comments
 (0)