Skip to content

Commit

Permalink
Update the help text for the Pylint descriptor
Browse files Browse the repository at this point in the history
The `msg-template` setting only works in the pylintrc configuration file
if it is under the `[REPORTS]` section header [0]. Otherwise the setting
gets ignored:
```
$ cat ./pylintrc
msg-template={path}:{module}:{line}: [{msg_id}({symbol}), {obj}] {msg}
$ pylint --rcfile=./pylintrc test.py
************* Module pylintrc
pylintrc:1:0: F0011: error while parsing the configuration: File contains no section headers.
file: 'pylintrc', line: 1
'msg-template={path}:{module}:{line}: [{msg_id}({symbol}), {obj}] {msg}\n' (config-parse-error)
[...]
```

Using the `--msg-template` CLI option is more convenient for the usage
inside Jenkins pipelines.

[0]: https://github.com/pylint-dev/pylint/blob/v2.17.4/examples/pylintrc#L481
  • Loading branch information
primeos-work committed Jul 18, 2023
1 parent ede6ea0 commit ff224ad
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ public IssueParser createParser(final Option... options) {

@Override
public String getHelp() {
return "<p>Create a ./pylintrc that contains:"
+ "<p><code>msg-template={path}:{module}:{line}: [{msg_id}({symbol}), {obj}] {msg}</code></p>"
+ "</p>"
+ "<p>Start pylint using the command:"
+ "<p><code>pylint --rcfile=./pylintrc CODE > pylint.log</code></p>"
return "<p>Start Pylint using this custom message template (can also be configured via a pylintrc configuration file):"
+ "<p><code>pylint --msg-template='{path}:{line}: [{msg_id}, {obj}] {msg} ({symbol})' ... > pylint.log</code></p>"
+ "</p>";
}

Expand Down

0 comments on commit ff224ad

Please sign in to comment.