Skip to main content

No project description provided

Project description

CQ

Code quality checker package

Usage

Checking

Just run cq in the root of your package.

$ cq
requirements_setup_compatibility
setup.py: setup.py: does not contain requirement 'coverage' that is in requirements.txt
dumb_style_checker
setup.py:20: Put exactly one space before and after `=`  [...     name='.........', ...].
package/api.py:191: Put exactly one space before and after `=`  [... def fake_localtime(t=None): ...].
pyflakes-ext
Hint: use `# NOQA` comment for disabling pyflakes on particular line
./tests/test_warnings.py:4: 'types' imported but unused
mypy
Hint: use `# type: ignore` for disabling mypy on particular line
package/api.py:42: error: Need type annotation for 'freeze_factories' (hint: "freeze_factories: List[<type>] = ...")
pylint
Hint: use `# pylint: disable=<violation name>` for disabling line check. For a list of violations, see `pylint --list-msgs`
package/api.py:56: [W0212(protected-access), ] Access to a protected member _uuid_generate_time of a client class

You can specify path to packages that you want to test, if you want to test whole library/app.

$ cq package_1 package_2

Checkers are run in threads. Some of them (e.g. pylint, mypy) spawn an external process so this checkers run in parallel.

To disable certain checker for the whole run add option -d:

$ cq -d pylint -d branch_name_check

Warnings are hidden by default. To display them, run cq with --show-warnings

$ cq --show-warnings

If something takes too long use debug output, which will print timing for each checker:

$ cq --debug

Most of the checkers support disabling the error in the comment on the respective line. For example in pylint you can use

# pylint: disable = protected-access

to disable protected access check in the current context.

Fixing

Just run cq --fix with the same options as regular cq.

Checkers

  • pylint - comprehensive linter
  • mypy - checks python typing
  • bellybutton - checks based on abstract syntax tree analysis
  • pyflakes-ext - another general linter
  • grammar_nazi - grammar/spelling errors
  • dumb_style_checker - basic python mistakes (e.g. use of print in a library)
  • requirements_setup_compatibility - validation of version compatibility between setup.py and requirements.txt
  • requirements-validator - requirements.txt validation
  • setup_check - setup.py validator
  • branch_name_check - check whether current branch name comply with Quantlane standards
  • orange - code formatter based on black
  • isort - isort your imports, so you don't have to
  • safety - checks installed dependencies for known security vulnerabilities

Fixers

  • orange - code formatter based on black
  • isort - isort your imports, so you don't have to

pylint

You can override the packaged pylint rules in .pylintrc in the root of your project (actually in $PWD/.pylintrc for cq run)

Pylint checker can output two types of issues: warning and error. Errors are in bold typeset. Warnings can (but should not) be ignored.

mypy

Config can be overridden by having mypy.ini in the root of your project

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

ql-cq-1.4.1.tar.gz (23.8 kB view details)

Uploaded Source

Built Distributions

ql_cq-1.4.1-py3-none-any.whl (33.0 kB view details)

Uploaded Python 3

ql_cq-1.4.1-py2-none-any.whl (31.0 kB view details)

Uploaded Python 2

File details

Details for the file ql-cq-1.4.1.tar.gz.

File metadata

  • Download URL: ql-cq-1.4.1.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3

File hashes

Hashes for ql-cq-1.4.1.tar.gz
Algorithm Hash digest
SHA256 008537709a9df8f17e8d3795e93ffdec0dd43d39513b07cec02d3a73a760c552
MD5 98dd00b26d6d6730261cb191ef65b966
BLAKE2b-256 f69e3d5ef845c60738e1496060bca454c76500fa059acbe428c51e588a4ae4da

See more details on using hashes here.

File details

Details for the file ql_cq-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: ql_cq-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 33.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3

File hashes

Hashes for ql_cq-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b968ed08d2bc1837098ec5364272e874118e7c3348993599f58e8997aaaa162a
MD5 4cbb4e88d484cc8923b0dc810e3bb506
BLAKE2b-256 8d50a4538d6fa604b8da9441fa2e7e21c615cbefa1a2426e16908e9cdd45d194

See more details on using hashes here.

File details

Details for the file ql_cq-1.4.1-py2-none-any.whl.

File metadata

  • Download URL: ql_cq-1.4.1-py2-none-any.whl
  • Upload date:
  • Size: 31.0 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3

File hashes

Hashes for ql_cq-1.4.1-py2-none-any.whl
Algorithm Hash digest
SHA256 a208a950e131bbe8ecb64e4f557e0a9d00b2198ef455eb0742dbdca483f61dd8
MD5 a2d9a6849b899891ba587e655296c4cd
BLAKE2b-256 5409606665088e722b833903ad2823458b39116effbccf1350f51c5ec3c428df

See more details on using hashes here.

Supported by

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