Skip to main content

edX-authored pylint checkers

Project description

CI

A collection of code quality tools:

  • A few pylint plugins to check for quality issues pylint misses.

  • A command-line tool to generate config files like pylintrc from a master file (part of edx_lint), and a repo-specific tweaks file.

Using edx_lint

The edx_lint command can generate config files from its own master file. Install the package using pip:

$ pip install edx-lint

The write sub-command will write a config file based on the contents of the edx_lint master file:

$ edx_lint write pylintrc

The file written contains a hash of its contents, to detect subsequent editing. edx_lint will detect this when it next tries to write the file. If editing is detected, the edited file will be moved aside so it can be compared to the newly written file.

Handling newly introduced lint violations

New potential lint violations will be communicated with a major version bump.

If you run into new lint violations during an upgrade of edx-lint, your options include:

  1. Fixing the violations immediately, or

  2. Using lint-amnesty and fixing at a later time, or

  3. Customizing edx_lint to permanently ignore the violations.

Using lint-amnesty

The lint-amnesty command can be used to squash all existing pylint errors in a codebase, so that from then the repository can maintain pylint-cleanliness. Install the package using pip:

$ pip install edx-lint

The lint-amnesty command expects pylint errors in the --output-format=parseable format:

$ pylint my.python.package --output-format=parseable | lint-amnesty

This will add comments for every existing pylint violation that look like:

# pylint: disable=some-error  # lint-amnesty

It will also remove any existing suppressions that pylint flags as being useless-suppressions.

Customizing edx_lint

You can customize the resulting pylintrc file by creating a pylintrc_tweaks file in the current directory before running the write sub-command. It should contain only the settings you want to override.

Note: If your project is not a Django project, you’ll want to disable the Django plugins with your pylintrc_tweaks file:

[MASTER]
load-plugins = edx_lint.pylint

Developing edx_lint

To run the tests:

$ make requirements
$ make test

To manually test your pylint plugin, create a custom module and run pylint with a selected set of enabled message symbols. For instance:

pylint --load-plugins=edx_lint.pylint --disable=all --enable=feature-toggle-needs-doc path/to/my/custom/module.py

License

The code in this repository is licensed under Apache 2.0. Please see LICENSE.txt for details.

How To Contribute

Contributions are very welcome.

Please read How To Contribute for details.

Getting Help

The Open edX project has resources for developer support on the Getting Help page.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

edx_lint-5.5.0.tar.gz (46.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edx_lint-5.5.0-py3-none-any.whl (54.8 kB view details)

Uploaded Python 3

File details

Details for the file edx_lint-5.5.0.tar.gz.

File metadata

  • Download URL: edx_lint-5.5.0.tar.gz
  • Upload date:
  • Size: 46.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for edx_lint-5.5.0.tar.gz
Algorithm Hash digest
SHA256 64ebc4adc5c6eb315ac8094952efef7c92a4dc0c51baee76cead599b78980100
MD5 386f612dfb5a6c1086d30853d45b92d2
BLAKE2b-256 41da1093bb7a4840a29cbec3893471387a9d9d6a33c9adf355d58f9711a8ca19

See more details on using hashes here.

File details

Details for the file edx_lint-5.5.0-py3-none-any.whl.

File metadata

  • Download URL: edx_lint-5.5.0-py3-none-any.whl
  • Upload date:
  • Size: 54.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for edx_lint-5.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fccec232b82d0107476f2989ec229f1bef926f48002fce65984cfda2af50a72
MD5 046157b831ac20d1ead794c15bc59aaa
BLAKE2b-256 bb06641f53b191e061c15ea41523f9f5684b2952a0dbc62d2702bf275cd7b681

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page