# 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`](https://www.pylint.org/) - comprehensive linter
- [`mypy`](http://mypy-lang.org/) - checks python typing
- [`pyflakes-ext`](https://pypi.org/project/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`](https://pip.pypa.io/en/latest/reference/pip_check/) - requirements.txt validation
- [`setup_check`](https://docs.python.org/3/distutils/examples.html#checking-a-package) - setup.py validator
- `branch_name_check` - check whether current branch name comply with Quantlane standards
- [`orange`](https://gitlab.com/quantlane/meta/orange) - code formatter based on `black`
- [`isort`](https://github.com/PyCQA/isort) - isort your imports, so you don't have to
- [`safety`](https://github.com/pyupio/safety) - checks installed dependencies for known security vulnerabilities
## Fixers
- [`orange`](https://gitlab.com/quantlane/meta/orange) - code formatter based on `black`
- [`isort`](https://github.com/PyCQA/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
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/quantlane/meta/cq",
"name": "ql-cq",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Quantlane",
"author_email": "code@quantlane.com",
"download_url": "https://files.pythonhosted.org/packages/31/6b/315546f0a88ce85319a517b8ab6a2439f1fc2844a4c43174993f25e1d5e5/ql_cq-1.8.0.tar.gz",
"platform": null,
"description": "# CQ\n\nCode quality checker package\n\n## Usage\n### Checking\n\nJust run `cq` in the root of your package.\n\n```\n$ cq\nrequirements_setup_compatibility\nsetup.py: setup.py: does not contain requirement 'coverage' that is in requirements.txt\ndumb_style_checker\nsetup.py:20: Put exactly one space before and after `=` [... name='.........', ...].\npackage/api.py:191: Put exactly one space before and after `=` [... def fake_localtime(t=None): ...].\npyflakes-ext\nHint: use `# NOQA` comment for disabling pyflakes on particular line\n./tests/test_warnings.py:4: 'types' imported but unused\nmypy\nHint: use `# type: ignore` for disabling mypy on particular line\npackage/api.py:42: error: Need type annotation for 'freeze_factories' (hint: \"freeze_factories: List[<type>] = ...\")\npylint\nHint: use `# pylint: disable=<violation name>` for disabling line check. For a list of violations, see `pylint --list-msgs`\npackage/api.py:56: [W0212(protected-access), ] Access to a protected member _uuid_generate_time of a client class\n```\nYou can specify path to packages that you want to test, if you want to test whole library/app.\n```\n$ cq package_1 package_2\n```\nCheckers are run in threads. Some of them (e.g. pylint, mypy) spawn an external process so this checkers run in parallel.\n\nTo disable certain checker for the whole run add option `-d`:\n```\n$ cq -d pylint -d branch_name_check\n```\n\nWarnings are hidden by default. To display them, run cq with `--show-warnings`\n```\n$ cq --show-warnings\n```\n\nIf something takes too long use debug output, which will print timing for each checker:\n```\n$ cq --debug\n```\n\nMost of the checkers support disabling the error in the comment on the respective line. For example in `pylint` you can use\n```\n# pylint: disable = protected-access\n```\nto disable protected access check in the current context.\n\n### Fixing\n\nJust run `cq --fix` with the same options as regular `cq`.\n\n## Checkers\n- [`pylint`](https://www.pylint.org/) - comprehensive linter\n- [`mypy`](http://mypy-lang.org/) - checks python typing\n- [`pyflakes-ext`](https://pypi.org/project/pyflakes-ext/) - another general linter\n- `grammar_nazi` - grammar/spelling errors\n- `dumb_style_checker` - basic python mistakes (e.g. use of print in a library)\n- `requirements_setup_compatibility` - validation of version compatibility between setup.py and requirements.txt\n- [`requirements-validator`](https://pip.pypa.io/en/latest/reference/pip_check/) - requirements.txt validation\n- [`setup_check`](https://docs.python.org/3/distutils/examples.html#checking-a-package) - setup.py validator\n- `branch_name_check` - check whether current branch name comply with Quantlane standards\n- [`orange`](https://gitlab.com/quantlane/meta/orange) - code formatter based on `black`\n- [`isort`](https://github.com/PyCQA/isort) - isort your imports, so you don't have to\n- [`safety`](https://github.com/pyupio/safety) - checks installed dependencies for known security vulnerabilities\n\n## Fixers\n- [`orange`](https://gitlab.com/quantlane/meta/orange) - code formatter based on `black`\n- [`isort`](https://github.com/PyCQA/isort) - isort your imports, so you don't have to\n\n### pylint\n\nYou can override the packaged pylint rules in `.pylintrc` in the root of your project (actually in `$PWD/.pylintrc` for `cq` run)\n\nPylint checker can output two types of issues: warning and error. Errors are in bold typeset. Warnings can (but should not) be ignored.\n\n### mypy\n\nConfig can be overridden by having `mypy.ini` in the root of your project\n\n",
"bugtrack_url": null,
"license": "Apache License, Version 2.0",
"summary": "Code quality checker",
"version": "1.8.0",
"project_urls": {
"Homepage": "https://gitlab.com/quantlane/meta/cq"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b3a9335dc09cc27453bafa7b90ba23c746543f29f10dbd0fcf0d9edff15ea1c9",
"md5": "8b029e4287d8c005ed4a0c90fc0238a8",
"sha256": "d89fb46227240b9cc2f0ff8144f544421faca4c23f45a6045284b37e2dd787ff"
},
"downloads": -1,
"filename": "ql_cq-1.8.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8b029e4287d8c005ed4a0c90fc0238a8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 41079,
"upload_time": "2024-03-19T08:42:21",
"upload_time_iso_8601": "2024-03-19T08:42:21.482092Z",
"url": "https://files.pythonhosted.org/packages/b3/a9/335dc09cc27453bafa7b90ba23c746543f29f10dbd0fcf0d9edff15ea1c9/ql_cq-1.8.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "316b315546f0a88ce85319a517b8ab6a2439f1fc2844a4c43174993f25e1d5e5",
"md5": "686d3c44010eb1984a9d522c696bda3f",
"sha256": "0e58391a9f569cc8d4087e0416d5e07a612ae077f1542d57c42eb62afaec2472"
},
"downloads": -1,
"filename": "ql_cq-1.8.0.tar.gz",
"has_sig": false,
"md5_digest": "686d3c44010eb1984a9d522c696bda3f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 28765,
"upload_time": "2024-03-19T08:42:23",
"upload_time_iso_8601": "2024-03-19T08:42:23.816828Z",
"url": "https://files.pythonhosted.org/packages/31/6b/315546f0a88ce85319a517b8ab6a2439f1fc2844a4c43174993f25e1d5e5/ql_cq-1.8.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-19 08:42:23",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "quantlane",
"gitlab_project": "meta",
"lcname": "ql-cq"
}