diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e93f9e68..153c7bf89 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,6 +59,7 @@ jobs: - run: flake8 - run: ufmt check . - run: python3 -m fixit.cli.run_rules + - run: python -m slotscheck libcst # Run pyre typechecker typecheck: diff --git a/README.rst b/README.rst index be1d5d94a..946168327 100644 --- a/README.rst +++ b/README.rst @@ -164,6 +164,13 @@ changes to be conformant, run the following in the root: ufmt format && python -m fixit.cli.apply_fix +We use `slotscheck `_ to check the correctness +of class ``__slots__``. To check that slots are defined properly, run: + +.. code-block:: shell + + python -m slotscheck libcst + To run all tests, you'll need to do the following in the root: .. code-block:: shell diff --git a/pyproject.toml b/pyproject.toml index 1d33e75e0..84cfc6282 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,5 +5,8 @@ exclude = "native/.*" [tool.ufmt] excludes = ["native/", "stubs/"] +[tool.slotscheck] +exclude-modules = '^libcst\.(testing|tests)' + [build-system] requires = ["setuptools", "wheel", "setuptools-rust"] \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt index 388c7556b..dbebc1850 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -15,3 +15,4 @@ sphinx-rtd-theme>=0.4.3 ufmt==1.3 usort==1.0.0rc1 setuptools-rust>=0.12.1 +slotscheck>=0.7.1