Skip to content

Commit ad7a541

Browse files
committed
Add score impact for each error/warning/info
1 parent cff0e9d commit ad7a541

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,17 @@ levels:
3737

3838
### Error: missing_email
3939

40+
**Score**: -15
41+
4042
**Issue**: the e-mail is required if the script is submitted in the official
4143
scripts repository (error can be ignored in other cases).
4244

4345
**How to fix**: add a contact e-mail in the header of the script.
4446

4547
### Error: missing_infolist_free
4648

49+
**Score**: -20
50+
4751
**Issue**: when an infolist is asked to WeeChat with `infolist_get`, it must
4852
always be freed by a call to `infolist_free`, otherwise this causes a memory leak.
4953

@@ -52,6 +56,8 @@ always be freed by a call to `infolist_free`, otherwise this causes a memory lea
5256

5357
### Error: python2_bin (Python script only)
5458

59+
**Score**: -25
60+
5561
**Issue**: the info `python2_bin` is used to find the path to Python 2.x
5662
interpreter. Since WeeChat is compiled with Python 3 and that all scripts aim
5763
to be compatible with Python 3, this info must not be used at all any more.
@@ -63,12 +69,16 @@ or [hook_process_hashtable](https://weechat.org/files/doc/stable/weechat_plugin_
6369

6470
### Error: mixed_tabs_spaces (Python script only)
6571

72+
**Score**: -25
73+
6674
**Issue**: mixed tabs and spaces are used for indentation.
6775

6876
**How to fix**: replace all tabs by spaces for indentation.
6977

7078
### Warning: sys_exit (Python script only)
7179

80+
**Score**: -10
81+
7282
**Issue**: the function `sys.exit()` causes WeeChat to exit itself, so it
7383
must not be used in scripts.\
7484
This is a warning and not an error because if it is used when the import of
@@ -81,20 +91,26 @@ consider setting a variable instead that will prevent the call to
8191

8292
### Warning: deprecated_hook_completion_get_string
8393

94+
**Score**: -8
95+
8496
**Issue**: the function `hook_completion_get_string` is deprecated and should
8597
not be used any more since WeeChat 2.9.
8698

8799
**How to fix**: call the function `completion_get_string`.
88100

89101
### Warning: deprecated_hook_completion_list_add
90102

103+
**Score**: -8
104+
91105
**Issue**: the function `hook_completion_list_add` is deprecated and should
92106
not be used any more since WeeChat 2.9.
93107

94108
**How to fix**: call the function `completion_list_add`.
95109

96110
### Warning: modifier_irc_in
97111

112+
**Score**: -10
113+
98114
**Issue**: the modifier `irc_in_xxx` sends the raw IRC message to the callback
99115
which may not be UTF-8 valid. This is a problem in some languages like Python.
100116

@@ -104,20 +120,26 @@ to receive invalid UTF-8 data.
104120

105121
### Warning: signal_irc_out
106122

123+
**Score**: -10
124+
107125
**Issue**: the signal `irc_out_xxx` sends the raw IRC message to the callback
108126
which may not be UTF-8 valid. This is a problem in some languages like Python.
109127

110128
**How to fix**: use the signal `irc_out1_xxx`.
111129

112130
### Warning: signal_irc_outtags
113131

132+
**Score**: -10
133+
114134
**Issue**: the signal `irc_outtags_xxx` sends the raw IRC message to the callback
115135
which may not be UTF-8 valid. This is a problem in some languages like Python.
116136

117137
**How to fix**: use the signal `irc_out1_xxx`.
118138

119139
### Warning: hook_process_url
120140

141+
**Score**: -5
142+
121143
**Issue**: the function `hook_process` used with `url:` should be
122144
replaced by the new function `hook_url` added in WeeChat 4.1.0, which uses
123145
a thread instead of a new process, making it more lightweight and thus
@@ -128,6 +150,8 @@ in code, as the function is different from `hook_process`.
128150

129151
### Warning: hook_process_hashtable_url
130152

153+
**Score**: -5
154+
131155
**Issue**: the function `hook_process_hashtable` used with `url:` should be
132156
replaced by the new function `hook_url` added in WeeChat 4.1.0, which uses
133157
a thread instead of a new process, making it more lightweight and thus
@@ -138,20 +162,26 @@ in code, as the function is different from `hook_process_hashtable`.
138162

139163
### Info: unneeded_shebang
140164

165+
**Score**: -1
166+
141167
**Issue**: the shebang is not needed, except if the script can be called
142168
outside WeeChat, which is rare.
143169

144170
**How to fix**: remove the shebang, unless it is really needed.
145171

146172
### Info: url_weechat
147173

174+
**Score**: -1
175+
148176
**Issue**: the WeeChat site URL is not the official one.
149177

150178
**How to fix**: replace the URL by the official one: [https://weechat.org](https://weechat.org)
151179
(`https` and no `www`).
152180

153181
### Info: missing_spdx_copyright
154182

183+
**Score**: -1
184+
155185
**Issue**: the copyright tag `SPDX-FileCopyrightText` is missing in the script header.
156186

157187
**How to fix**: add the [SPDX](https://spdx.dev/) copyright tag `SPDX-FileCopyrightText`
@@ -160,6 +190,8 @@ in the script header
160190

161191
### Info: missing_spdx_license
162192

193+
**Score**: -1
194+
163195
**Issue**: the license tag `SPDX-License-Identifier` is missing in the script header.
164196

165197
**How to fix**: add the [SPDX](https://spdx.dev/) license tag `SPDX-License-Identifier`

0 commit comments

Comments
 (0)