Skip to content

Patched documentation for enabled Pylint messages - #1422

Open
angelayzheng wants to merge 8 commits into
pyta-uoft:masterfrom
angelayzheng:patch-error-documentation
Open

angelayzheng wants to merge 8 commits into
pyta-uoft:masterfrom
angelayzheng:patch-error-documentation

Conversation

@angelayzheng

@angelayzheng angelayzheng commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Proposed Changes

We are currently missing documentation for 80 Pylint messages that are enabled and can be emitted by PythonTA.

  • This PR adds documentation for the first 10 of these messages, detailed below. Existing example files were used when available; otherwise, example files were added.
    • C0114: missing-module-docstring
    • C0115: missing-class-docstring
    • C0116: missing-function-docstring
    • C0303: trailing-whitespace
    • C0414: useless-import-alias
    • C1802: use-implicit-booleaness-not-len
    • C2401: non-ascii-name
    • C2403: non-ascii-module-import
    • E0011: unrecognized-inline-option
    • E0013: bad-plugin-value
  • To programmatically determine which messages are missing (and how many there are), a standalone script has been created (scripts/check_message_documentation.py), with instructions for running it in the script's docstring.
  • One of the errors, E0011: unrecognized-inline-option, requires the option allow_pylint_comments to be enabled in test_examples.py to correctly test its corresponding example file. Thus, an additional fixture and test have been added to test messages requiring this option.
Screenshots of your changes (if applicable)

N/A

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
✨ New feature (non-breaking change that adds functionality)
🐛 Bug fix (non-breaking change that fixes an issue)
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests) x
📚 Documentation update (change that only updates documentation) x
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

Checklist

(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the [ ] into a [x] in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)

Before opening your pull request:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • I have updated the project Changelog (this is required for all changes).
  • If this is my first contribution, I have added myself to the list of contributors.

After opening your pull request:

  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

Questions and Comments

  • 6 out of the 10 added messages already had example files. It seems like these messages were omitted from the original Sphinx documentation, that was implemented in PR docs: Use Sphinx to generate documentation website. #675. Was there a reason for these being omitted at the time?
  • Adding the new test and fixture with the allow-pylint-comments option enabled is required to properly test the example file for E0011: unrecognized-inline-option, but I know this could be considered out of scope compared to the rest of the PR (which has to do with simply updating documentation). Do you think this change should still be included as part of this PR?

@coveralls

coveralls commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 40814905485

Coverage remained the same at 91.587%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4172
Covered Lines: 3821
Line Coverage: 91.59%
Coverage Strength: 21.25 hits per line

💛 - Coveralls

@angelayzheng angelayzheng changed the title Patch documentation for enabled Pylint messages Patched documentation for enabled Pylint messages Oct 23, 2026

@david-yz-liu david-yz-liu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @angelayzheng! In response to your questions:

  • I don't think there was a good reason for the previous errors to be omitted from the documentation
  • adding the next test and fixture for the unrecognized-inline-option check is good


This error occurs when an import alias is the same as the original package name.

```{literalinclude} /../../../examples/pylint/c0414_useless_import_alias.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add a corrected version of this example

Comment thread scripts/check_message_documentation.py Outdated


if __name__ == "__main__":
raise SystemExit(main())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it's a bit more idiomatic to use sys.exit instead of raising SystemExit

@angelayzheng

Copy link
Copy Markdown
Member Author

Thank you @david-yz-liu! I've addressed both of your comments in my new commits.

@@ -1,4 +1,3 @@
"""C0115: Missing class docstring."""

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I also removed this line (and the corresponding one for C0116) to be consistent with the rest of the example files, which do not state the error code and name at the top of the file.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants