Name | gitlab-cq JSON |
Version |
0.2.0
JSON |
| download |
home_page | None |
Summary | Parse linter output and convert it to GitLab Code Quality report |
upload_time | 2024-09-19 06:00:44 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License Copyright (c) 2024 Yoshiki Matsuda Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
linter
gitlab
code quality
report
ruff
pyright
mypy
gcc
clang
clang-tidy
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# GitLab-CQ
Parse linter output and convert it to [GitLab Code Quality](https://docs.gitlab.com/ee/ci/testing/code_quality.html) report.
## Supported Linters
* [Ruff](https://docs.astral.sh/ruff/)
* [Pyright](https://microsoft.github.io/pyright/#/)
* [Mypy](https://mypy.readthedocs.io/en/stable/)
* [GCC/Clang](https://gcc.gnu.org/)
* [Clang-Tidy](https://clang.llvm.org/extra/clang-tidy/)
Pull Requests for additional linter support are welcome.
## Installation
```bash
$ python -m pip install -U gitlab-cq
```
Or use pipx:
```bash
$ pipx install gitlab-cq
```
## Usage
There are two ways to use GitLab-CQ: run linter command via. GitLab-CQ or parse linter output from stdin.
Run linter command via. GitLab-CQ:
```bash
$ gitlab-cq [--output file_path] [--merge] [--echo] CMD [Arguments]
```
Parse linter output from stdin:
```bash
$ CMD [Arguments] | gitlab-cq [--output file_path] [--merge] [--echo] LINTER
```
Arguments:
* `CMD`:
* Command to run linter.
* `Arguments`:
* Arguments for linter command.
* `LINTER`:
* Linter name to parse: `{ruff, pyright, mypy, gcc, clang-tidy, clang}`
Options:
* `--output file_path`:
* Output to file_path.
* `--merge`:
* Merge output to existing JSON file (available if `--output` is specified).
* `--echo`:
* Echo linter output (available if `--output` is specified).
### Required options for linters
The following options are required for linters when parsing from stdin.
(No need to add the following when the linter runs via. GitLab-CQ, since these options are automatically added.)
* `ruff`:
* `--output-format json` is required and do not pass `--output` option.
* `pyright`:
* `--outputjson` is required.
* `mypy`:
* `--output=json` is required.
## Example
Integration to GitLab CI and save an GitLab CQ artifact:
```yaml
code quality:
stage: test
script:
# Run linters via. GitLab-CQ and merge output to gl-code-quality-report.json
- pipx install gitlab-cq
- gitlab-cq --output gl-code-quality-report.json ruff check .
- gitlab-cq --output gl-code-quality-report.json --merge pyright .
- gitlab-cq --output gl-code-quality-report.json --merge mypy .
# Parse linter/compiler output and merge to gl-code-quality-report.json
- gcc -Wall -Wextra -o /dev/null -c main.c 2>&1 | gitlab-cq --output gl-code-quality-report.json --merge gcc
- clang-tidy -format-style=file -p . --quiet main.c | gitlab-cq --output gl-code-quality-report.json --merge clang-tidy
artifacts:
reports:
codequality: gl-code-quality-report.json
```
## Author
Yoshiki Matsuda (@yosh-matsuda)
Raw data
{
"_id": null,
"home_page": null,
"name": "gitlab-cq",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Yoshiki Matsuda <y_matsuda@fixstars.com>",
"keywords": "linter, gitlab, code quality, report, ruff, pyright, mypy, gcc, clang, clang-tidy",
"author": null,
"author_email": "Yoshiki Matsuda <y_matsuda@fixstars.com>",
"download_url": "https://files.pythonhosted.org/packages/b0/98/80a79dad1e620089d3ea20eaa4678f91ed79b34cb2265c37d7e55e0374a3/gitlab_cq-0.2.0.tar.gz",
"platform": null,
"description": "# GitLab-CQ\n\nParse linter output and convert it to [GitLab Code Quality](https://docs.gitlab.com/ee/ci/testing/code_quality.html) report.\n\n## Supported Linters\n\n* [Ruff](https://docs.astral.sh/ruff/)\n* [Pyright](https://microsoft.github.io/pyright/#/)\n* [Mypy](https://mypy.readthedocs.io/en/stable/)\n* [GCC/Clang](https://gcc.gnu.org/)\n* [Clang-Tidy](https://clang.llvm.org/extra/clang-tidy/)\n\nPull Requests for additional linter support are welcome.\n\n## Installation\n\n```bash\n$ python -m pip install -U gitlab-cq\n```\n\nOr use pipx:\n\n```bash\n$ pipx install gitlab-cq\n```\n\n## Usage\n\nThere are two ways to use GitLab-CQ: run linter command via. GitLab-CQ or parse linter output from stdin.\n\nRun linter command via. GitLab-CQ:\n\n```bash\n$ gitlab-cq [--output file_path] [--merge] [--echo] CMD [Arguments]\n```\n\nParse linter output from stdin:\n\n```bash\n$ CMD [Arguments] | gitlab-cq [--output file_path] [--merge] [--echo] LINTER\n```\n\nArguments:\n\n* `CMD`:\n * Command to run linter.\n* `Arguments`:\n * Arguments for linter command.\n* `LINTER`:\n * Linter name to parse: `{ruff, pyright, mypy, gcc, clang-tidy, clang}`\n\nOptions:\n\n* `--output file_path`:\n * Output to file_path.\n* `--merge`:\n * Merge output to existing JSON file (available if `--output` is specified).\n* `--echo`:\n * Echo linter output (available if `--output` is specified).\n\n### Required options for linters\n\nThe following options are required for linters when parsing from stdin. \n(No need to add the following when the linter runs via. GitLab-CQ, since these options are automatically added.)\n\n* `ruff`:\n * `--output-format json` is required and do not pass `--output` option.\n* `pyright`:\n * `--outputjson` is required.\n* `mypy`:\n * `--output=json` is required.\n\n## Example\n\nIntegration to GitLab CI and save an GitLab CQ artifact:\n\n```yaml\ncode quality:\n stage: test\n script:\n # Run linters via. GitLab-CQ and merge output to gl-code-quality-report.json\n - pipx install gitlab-cq\n - gitlab-cq --output gl-code-quality-report.json ruff check .\n - gitlab-cq --output gl-code-quality-report.json --merge pyright .\n - gitlab-cq --output gl-code-quality-report.json --merge mypy .\n # Parse linter/compiler output and merge to gl-code-quality-report.json\n - gcc -Wall -Wextra -o /dev/null -c main.c 2>&1 | gitlab-cq --output gl-code-quality-report.json --merge gcc\n - clang-tidy -format-style=file -p . --quiet main.c | gitlab-cq --output gl-code-quality-report.json --merge clang-tidy \n artifacts:\n reports:\n codequality: gl-code-quality-report.json\n```\n\n## Author\n\nYoshiki Matsuda (@yosh-matsuda)\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Yoshiki Matsuda Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Parse linter output and convert it to GitLab Code Quality report",
"version": "0.2.0",
"project_urls": {
"Repository": "https://github.com/yosh-matsuda/gitlab-cq"
},
"split_keywords": [
"linter",
" gitlab",
" code quality",
" report",
" ruff",
" pyright",
" mypy",
" gcc",
" clang",
" clang-tidy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "21f44c5a4608458d61adf019a409821a635a43b584899445484d8dbb824ad17a",
"md5": "92a66c8807e211e0d84603c3252224be",
"sha256": "3f629c861fb446d4e54c882c8d3d2f3cc19eaa266451054587802a7f7c26484e"
},
"downloads": -1,
"filename": "gitlab_cq-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "92a66c8807e211e0d84603c3252224be",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 11068,
"upload_time": "2024-09-19T06:00:42",
"upload_time_iso_8601": "2024-09-19T06:00:42.825460Z",
"url": "https://files.pythonhosted.org/packages/21/f4/4c5a4608458d61adf019a409821a635a43b584899445484d8dbb824ad17a/gitlab_cq-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b09880a79dad1e620089d3ea20eaa4678f91ed79b34cb2265c37d7e55e0374a3",
"md5": "d58f95e6f32122f34e7f244beaf88c8c",
"sha256": "74043e055824154abc443032c0f7b9b25a79432b0325cdc25c23600d3898a590"
},
"downloads": -1,
"filename": "gitlab_cq-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "d58f95e6f32122f34e7f244beaf88c8c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 12851,
"upload_time": "2024-09-19T06:00:44",
"upload_time_iso_8601": "2024-09-19T06:00:44.622824Z",
"url": "https://files.pythonhosted.org/packages/b0/98/80a79dad1e620089d3ea20eaa4678f91ed79b34cb2265c37d7e55e0374a3/gitlab_cq-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-19 06:00:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yosh-matsuda",
"github_project": "gitlab-cq",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "gitlab-cq"
}