mypy-gitlab-code-quality


Namemypy-gitlab-code-quality JSON
Version 1.1.0 PyPI version JSON
download
home_page
SummarySimple script to generate gitlab code quality report from output of mypy.
upload_time2023-11-17 16:48:51
maintainer
docs_urlNone
authorOokamiTheLord
requires_python>=3.8
licenseMIT License Copyright (c) 2021 Dmitry Samsonov 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 gitlab gitlab-ci mypy codequality
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Gitlab-CI](https://img.shields.io/badge/GitLab_CI-indigo?logo=gitlab)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mypy-gitlab-code-quality)
[![PyPI](https://img.shields.io/pypi/v/mypy-gitlab-code-quality)](https://pypi.org/project/mypy-gitlab-code-quality/)
[![Downloads](https://static.pepy.tech/badge/mypy-gitlab-code-quality/month)](https://pepy.tech/project/mypy-gitlab-code-quality)
![PyPI - License](https://img.shields.io/pypi/l/mypy-gitlab-code-quality)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

# mypy-gitlab-code-quality
Simple script to generate [gitlab code quality report](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html)
from output of [mypy](http://www.mypy-lang.org/).

Example gitlab codequality report from [gitlab documentation](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html#code-quality-widget):
![Example gitlab codequality report](https://docs.gitlab.com/ee/ci/testing/img/code_quality_widget_13_11.png)

# Usage
`$ mypy program.py | mypy-gitlab-code-quality`

This command send to `STDOUT` generated json that can be used as Code Quality report artifact.

## Example .gitlab-ci.yml
```yaml
image: python:alpine
variables:
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"

cache:
  paths:
    - .cache/pip/
    - venv/
    - .mypy_cache/

before_script:
  - python --version  # For debugging
  - python -m venv venv
  - . venv/bin/activate

codequality:
  script:
    - pip install mypy mypy-gitlab-code-quality
    - mypy program.py --no-error-summary > mypy-out.txt || true  # "|| true" is used for preventing job fail when mypy find errors
    - mypy-gitlab-code-quality < mypy-out.txt > codequality.json
  artifacts:
    when: always
    reports:
      codequality: codequality.json
```
Note: if you want to use this example you should replace `program.py` with yours module names.

# Contributing
Please run linters before creating merge request
```shell
pip install requirements/dev.txt
black .
mypy .
ruff .
```
Suggestions and merge requests are always welcome :)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "mypy-gitlab-code-quality",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "gitlab,gitlab-ci,mypy,codequality",
    "author": "OokamiTheLord",
    "author_email": "Dmitry Samsonov <dmitriy.samsonov28@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/b0/f8/da1b4609553ab07712490b9da8eda2de70805c113070833361aabf01ba83/mypy-gitlab-code-quality-1.1.0.tar.gz",
    "platform": null,
    "description": "![Gitlab-CI](https://img.shields.io/badge/GitLab_CI-indigo?logo=gitlab)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mypy-gitlab-code-quality)\n[![PyPI](https://img.shields.io/pypi/v/mypy-gitlab-code-quality)](https://pypi.org/project/mypy-gitlab-code-quality/)\n[![Downloads](https://static.pepy.tech/badge/mypy-gitlab-code-quality/month)](https://pepy.tech/project/mypy-gitlab-code-quality)\n![PyPI - License](https://img.shields.io/pypi/l/mypy-gitlab-code-quality)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\n# mypy-gitlab-code-quality\nSimple script to generate [gitlab code quality report](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html)\nfrom output of [mypy](http://www.mypy-lang.org/).\n\nExample gitlab codequality report from [gitlab documentation](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html#code-quality-widget):\n![Example gitlab codequality report](https://docs.gitlab.com/ee/ci/testing/img/code_quality_widget_13_11.png)\n\n# Usage\n`$ mypy program.py | mypy-gitlab-code-quality`\n\nThis command send to `STDOUT` generated json that can be used as Code Quality report artifact.\n\n## Example .gitlab-ci.yml\n```yaml\nimage: python:alpine\nvariables:\n  PIP_CACHE_DIR: \"$CI_PROJECT_DIR/.cache/pip\"\n\ncache:\n  paths:\n    - .cache/pip/\n    - venv/\n    - .mypy_cache/\n\nbefore_script:\n  - python --version  # For debugging\n  - python -m venv venv\n  - . venv/bin/activate\n\ncodequality:\n  script:\n    - pip install mypy mypy-gitlab-code-quality\n    - mypy program.py --no-error-summary > mypy-out.txt || true  # \"|| true\" is used for preventing job fail when mypy find errors\n    - mypy-gitlab-code-quality < mypy-out.txt > codequality.json\n  artifacts:\n    when: always\n    reports:\n      codequality: codequality.json\n```\nNote: if you want to use this example you should replace `program.py` with yours module names.\n\n# Contributing\nPlease run linters before creating merge request\n```shell\npip install requirements/dev.txt\nblack .\nmypy .\nruff .\n```\nSuggestions and merge requests are always welcome :)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2021 Dmitry Samsonov  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": "Simple script to generate gitlab code quality report from output of mypy.",
    "version": "1.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/soul-catcher/mypy-gitlab-code-quality/issues",
        "Homepage": "https://github.com/soul-catcher/mypy-gitlab-code-quality"
    },
    "split_keywords": [
        "gitlab",
        "gitlab-ci",
        "mypy",
        "codequality"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "73dbb55c0169f6df6dc3cf7d0102a94c6bbb975b248d79385f91e0dbc2251cc5",
                "md5": "04ed27d1cf2081bff2d6acfcd9e52985",
                "sha256": "9890808b69a9e079ee852c482612c10008b39c767c96c5bab55aa9a0a4a970ba"
            },
            "downloads": -1,
            "filename": "mypy_gitlab_code_quality-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "04ed27d1cf2081bff2d6acfcd9e52985",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5343,
            "upload_time": "2023-11-17T16:48:50",
            "upload_time_iso_8601": "2023-11-17T16:48:50.006977Z",
            "url": "https://files.pythonhosted.org/packages/73/db/b55c0169f6df6dc3cf7d0102a94c6bbb975b248d79385f91e0dbc2251cc5/mypy_gitlab_code_quality-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b0f8da1b4609553ab07712490b9da8eda2de70805c113070833361aabf01ba83",
                "md5": "91764087b975c09f111820f2bb1a604e",
                "sha256": "be06b0def23b11f9ba10dda368cdb15f6320b9beb59b02d72642185630ee80e1"
            },
            "downloads": -1,
            "filename": "mypy-gitlab-code-quality-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "91764087b975c09f111820f2bb1a604e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 4432,
            "upload_time": "2023-11-17T16:48:51",
            "upload_time_iso_8601": "2023-11-17T16:48:51.495927Z",
            "url": "https://files.pythonhosted.org/packages/b0/f8/da1b4609553ab07712490b9da8eda2de70805c113070833361aabf01ba83/mypy-gitlab-code-quality-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-17 16:48:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "soul-catcher",
    "github_project": "mypy-gitlab-code-quality",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "mypy-gitlab-code-quality"
}
        
Elapsed time: 0.14364s