{"id":27136325,"url":"https://github.com/niclasvaneyk/pytest-gitlab-code-quality","last_synced_at":"2025-04-08T02:04:35.262Z","repository":{"id":230402743,"uuid":"778543750","full_name":"NiclasvanEyk/pytest-gitlab-code-quality","owner":"NiclasvanEyk","description":"⚠️ Collects warnings while testing and generates a GitLab Code Quality Report.","archived":false,"fork":false,"pushed_at":"2024-12-19T21:29:10.000Z","size":714,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T16:09:05.087Z","etag":null,"topics":["gitlab","gitlab-ci","gitlab-code-quality","pytest","pytest-plugin"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pytest-gitlab-code-quality","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NiclasvanEyk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"NiclasvanEyk"}},"created_at":"2024-03-27T23:11:44.000Z","updated_at":"2025-02-20T10:24:01.000Z","dependencies_parsed_at":"2024-03-29T14:30:22.508Z","dependency_job_id":"a98d30d6-8483-499a-8412-a94ecca87fd7","html_url":"https://github.com/NiclasvanEyk/pytest-gitlab-code-quality","commit_stats":null,"previous_names":["niclasvaneyk/pytest-gitlab-codequality","niclasvaneyk/pytest-gitlab-code-quality"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiclasvanEyk%2Fpytest-gitlab-code-quality","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiclasvanEyk%2Fpytest-gitlab-code-quality/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiclasvanEyk%2Fpytest-gitlab-code-quality/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiclasvanEyk%2Fpytest-gitlab-code-quality/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NiclasvanEyk","download_url":"https://codeload.github.com/NiclasvanEyk/pytest-gitlab-code-quality/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247761149,"owners_count":20991545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gitlab","gitlab-ci","gitlab-code-quality","pytest","pytest-plugin"],"created_at":"2025-04-08T02:04:34.777Z","updated_at":"2025-04-08T02:04:35.254Z","avatar_url":"https://github.com/NiclasvanEyk.png","language":"Python","readme":"# GitLab Code Quality for Pytest\n\n![current package version](https://img.shields.io/pypi/v/pytest-gitlab-code-quality)\n![supported Python versions](https://img.shields.io/pypi/pyversions/pytest-gitlab-code-quality)\n![github sponsors](https://img.shields.io/github/sponsors/NiclasvanEyk)\n![license](https://img.shields.io/github/license/NiclasvanEyk/pytest-gitlab-code-quality)\n\nEnables GitLab to collect and show warnings emitted during your test runs through their [code quality report].\n\n| Terminal | GitLab |\n|----------|--------|\n| ![Pytest warnings in the terminal](https://github.com/NiclasvanEyk/pytest-gitlab-code-quality/blob/main/.github/images/terminal.png?raw=true) | ![Pytest warnings in the GitLab merge request widget](https://github.com/NiclasvanEyk/pytest-gitlab-code-quality/blob/main/.github/images/gitlab.png?raw=true) |\n\nIf you run GitLab Premium or Ultimate, you should even see the warnings [right next to the code](https://docs.gitlab.com/ee/ci/testing/code_quality.html#merge-request-changes-view) in the diff view of merge requests.\nThe [official documentation](https://docs.gitlab.com/ee/ci/testing/code_quality.html) contains more information and screenshots.\n\n## Getting Started\n\nInstall the plugin using a package manager of your choice\n\n```shell\npip install pytest-gitlab-code-quality\n```\n\nthen specify the output location for the report using the `--gitlab-code-quality-report` option\n\n```shell\npytest --gitlab-code-quality-report=pytest-warnings.json\n```\n\nIn GitLab CI, this will look similar to this:\n\n```yaml\n# .gitlab-ci.yml\npytest:\n  stage: test\n  image: python\n  script:\n    - pip install -r requirements.txt # Or however you install your dependencies\n    - python -m pytest --gitlab-code-quality-report=pytest-warnings.json\n\n  # The three lines below are required in order for the warnings to show up!\n  artifacts:\n    reports:\n      codequality: pytest-warnings.json\n```\n\n## Motivation\n\nSome warnings are only surfaced during runtime, so static analyzers do not always catch them.\nThe screenshots at the top of this document contain the example of a questionably configured SQLAlchemy model.\nTests are a cheap way to surface such issues.\n\nWhile you may run the tests locally and see these warnings there, you also might overlook them or don't know whether they were introduced by your changes or were already present before.\nEither way, I think it makes sense to explicitly surface and track them during code review instead of burying them in the CI logs that nobody looks at when the tests pass.\nAnd that is exactly why this plugin was created.\n","funding_links":["https://github.com/sponsors/NiclasvanEyk"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniclasvaneyk%2Fpytest-gitlab-code-quality","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniclasvaneyk%2Fpytest-gitlab-code-quality","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniclasvaneyk%2Fpytest-gitlab-code-quality/lists"}