Skip to content

improved integration with CI platforms

regular pyright has third party integrations for github actions and gitlab, but they are difficult to install/set up. these integrations are built into basedpyright, which makes them much easier to use.

github actions

basedpyright automatically detects when it's running in a github action, and modifies its output to use github workflow commands. this means errors will be displayed on the affected lines of code in your pull requests automatically:

image

this is an improvement to regular pyright, which requires you to use a third party action that requires boilerplate to get working. basedpyright just does it automatically without you having to do anything special:

.github/workflows/your_workflow.yaml
jobs:
    check:
        steps:
            - run: ... # checkout repo, install dependencies, etc
            - run: basedpyright # no additional arguments required. it automatically detects if it's running in a github action

gitlab code quality reports

the --gitlabcodequality argument will output a gitlab code quality report which shows up on merge requests:

image

to enable this in your gitlab CI, just specify a file path to output the report to, and in the artifacts.reports.codequality section of your .gitlab-ci.yml file:

.gitlab-ci.yml
basedpyright:
    script: basedpyright --gitlabcodequality report.json
    artifacts:
        reports:
            codequality: report.json