Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the help text for the Pylint descriptor #933

Merged

Conversation

primeos-work
Copy link
Contributor

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.


Related Jira issue: https://issues.jenkins.io/browse/JENKINS-71665

TODO: SUPPORTED-FORMATS.md must be regenerated.

Testing done

Submitter checklist

@primeos-work
Copy link
Contributor Author

@uhafner could you please regenerate SUPPORTED-FORMATS.md for me (since I don't have a development setup for this repo)?

@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #933 (666a98a) into master (ede6ea0) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##             master     #933   +/-   ##
=========================================
  Coverage     92.89%   92.89%           
  Complexity     2322     2322           
=========================================
  Files           341      341           
  Lines          6450     6450           
  Branches        669      669           
=========================================
  Hits           5992     5992           
  Misses          262      262           
  Partials        196      196           
Impacted Files Coverage Δ
.../hm/hafner/analysis/registry/PyLintDescriptor.java 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@uhafner uhafner added the documentation Enhancement of documentation label Jul 18, 2023
Copy link
Member

@uhafner uhafner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please run mvn verify then the file will be re-generated. Then you can commit it as well.

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
@primeos-work primeos-work force-pushed the improve-pylint-descriptor-help-text branch from ff224ad to 666a98a Compare July 20, 2023 16:50
@primeos-work
Copy link
Contributor Author

primeos-work commented Jul 20, 2023

Ok, I just did that and amended the commit. I also replaced ... with modules_or_packages (based on https://pylint.readthedocs.io/en/stable/user_guide/usage/run.html) as ... somehow resulted in a missing whitespace character before ...:

               :bulb: <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>

@uhafner uhafner merged commit 0991fa3 into jenkinsci:master Jul 21, 2023
25 checks passed
@uhafner
Copy link
Member

uhafner commented Jul 21, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Enhancement of documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants