You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Contributing.md
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,8 @@ New scripts are added with pull requests against master branch of this repositor
32
32
- make your Python script compatible with Python 3.x, the support of Python 2.x is now optional
33
33
- use the official WeeChat URL: [https://weechat.org](https://weechat.org) (`https` and no `www.`) in any link to the WeeChat website.
34
34
35
+
Your script is automatically checked in CI, see [Automatic checks on scripts](#automatic-checks-on-scripts).
36
+
35
37
## Updating a script
36
38
37
39
### Contacting the author
@@ -60,6 +62,8 @@ Scripts updates are made with pull requests against master branch of this reposi
60
62
- 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
61
63
- make any Python script compatible with Python 3.x, the support of Python 2.x is now optional.
62
64
65
+
The script is automatically checked in CI, see [Automatic checks on scripts](#automatic-checks-on-scripts).
66
+
63
67
## Deleting a script
64
68
65
69
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
76
80
- fill the pull request template
77
81
- make only one commit to delete only one script
78
82
- 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:
0 commit comments