diff --git a/.github/workflows/mypy_primer.yaml b/.github/workflows/mypy_primer.yaml index 2ca8f2d50e..c2329ae126 100644 --- a/.github/workflows/mypy_primer.yaml +++ b/.github/workflows/mypy_primer.yaml @@ -52,6 +52,8 @@ jobs: run: | cd ruff + PRIMER_SELECTOR="$(paste -s -d'|' crates/red_knot_python_semantic/resources/primer/good.txt)" + echo "new commit" git rev-list --format=%s --max-count=1 "$GITHUB_SHA" @@ -62,13 +64,14 @@ jobs: cd .. + echo "Project selector: $PRIMER_SELECTOR" # Allow the exit code to be 0 or 1, only fail for actual mypy_primer crashes/bugs uvx mypy_primer \ --repo ruff \ --type-checker knot \ --old base_commit \ --new "$GITHUB_SHA" \ - --project-selector '/(mypy_primer|black|pyp|git-revise|zipp|arrow|isort|itsdangerous|rich|packaging|pybind11|pyinstrument|typeshed-stats|scrapy|werkzeug|bidict|async-utils|python-chess|dacite|python-htmlgen|paroxython|porcupine|psycopg)$' \ + --project-selector "/($PRIMER_SELECTOR)\$" \ --output concise \ --debug > mypy_primer.diff || [ $? -eq 1 ] diff --git a/crates/red_knot/docs/mypy_primer.md b/crates/red_knot/docs/mypy_primer.md index d3898a2a35..c4d73add14 100644 --- a/crates/red_knot/docs/mypy_primer.md +++ b/crates/red_knot/docs/mypy_primer.md @@ -31,7 +31,7 @@ mypy_primer \ ``` This will show the diagnostics diff for the `black` project between the `main` branch and your `my/feature` branch. To run the -diff for all projects, you currently need to copy the project-selector regex from the CI pipeline in `.github/workflows/mypy_primer.yaml`. +diff for all projects we currently enable in CI, use `--project-selector "/($(paste -s -d'|' crates/red_knot_python_semantic/resources/primer/good.txt))\$"`. You can also take a look at the [full list of ecosystem projects]. Note that some of them might still need a `knot_paths` configuration option to work correctly. diff --git a/crates/red_knot_python_semantic/resources/primer/good.txt b/crates/red_knot_python_semantic/resources/primer/good.txt new file mode 100644 index 0000000000..360e1e72ef --- /dev/null +++ b/crates/red_knot_python_semantic/resources/primer/good.txt @@ -0,0 +1,23 @@ +arrow +async-utils +bidict +black +dacite +git-revise +isort +itsdangerous +mypy_primer +packaging +paroxython +porcupine +psycopg +pybind11 +pyinstrument +pyp +python-chess +python-htmlgen +rich +scrapy +typeshed-stats +werkzeug +zipp