diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c7d3962..c5072d9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,6 +16,9 @@ jobs: os: [ ubuntu-18.04, macos-latest, windows-latest ] runs-on: ${{ matrix.os }} steps: + - uses: extractions/setup-just@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: @@ -25,12 +28,8 @@ jobs: with: poetry-version: ${{ matrix.poetry-version }} - name: Install dependencies - run: poetry install - - name: Run Ruff - run: poetry run ruff ./ruff_lsp ./tests - - name: Run Black - run: poetry run black --check ./ruff_lsp ./tests - - name: Run Mypy - run: poetry run mypy ./ruff_lsp ./tests - - name: Run unittest - run: poetry run python -m unittest + run: just install + - name: Run checks + run: just check + - name: Run tests + run: just test diff --git a/Makefile b/Makefile deleted file mode 100644 index be4b963..0000000 --- a/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -fmt: - poetry run ruff --fix ./ruff_lsp ./tests - poetry run black ./ruff_lsp ./tests - -check: - poetry run ruff ./ruff_lsp ./tests - poetry run black --check ./ruff_lsp ./tests - poetry run mypy ./ruff_lsp ./tests - -test: - poetry run python -m unittest - -.PHONY: fmt check test diff --git a/README.md b/README.md index fe74017..0b4b8fe 100644 --- a/README.md +++ b/README.md @@ -179,12 +179,16 @@ the following settings are supported: ## Development +Install [`just`](https://github.com/casey/just). + `ruff-lsp` uses Poetry for environment management and packaging. To get started, clone the -repository, install Poetry, and run `poetry install`. +repository, install Poetry, and run `poetry install` (or `just install`). + +To automatically format the codebase, run: `just fmt`. -To automatically format the codebase, run: `make format`. +To run lint and type checks, run: `just check`. -To run lint and type checks, run: `make check`. +To run tests, run: `just test`. ## License diff --git a/justfile b/justfile new file mode 100644 index 0000000..4eb40ce --- /dev/null +++ b/justfile @@ -0,0 +1,19 @@ +default: fmt check + +lock: + poetry lock + +install: + poetry install + +fmt: + poetry run ruff --fix ./ruff_lsp ./tests + poetry run black ./ruff_lsp ./tests + +check: + poetry run ruff ./ruff_lsp ./tests + poetry run black --check ./ruff_lsp ./tests + poetry run mypy ./ruff_lsp ./tests + +test: + poetry run python -m unittest diff --git a/poetry.lock b/poetry.lock index 4572bfa..33dccb7 100644 --- a/poetry.lock +++ b/poetry.lock @@ -287,28 +287,28 @@ test = ["coverage", "pycodestyle", "pyflakes", "pylint", "pytest", "pytest-cov"] [[package]] name = "ruff" -version = "0.0.192" +version = "0.0.193" description = "An extremely fast Python linter, written in Rust." category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.0.192-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:eac8b1447b82744aa6d64303be081227bbc9a6c3577c793f4cf8ed5c09decb71"}, - {file = "ruff-0.0.192-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:71d49353a7e8799bc879df9cc17e2f2a8664240617b25a11db517d97ed65b377"}, - {file = "ruff-0.0.192-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:113562bc3298b680df41c4a26fb55d10ed6e38432e987437302e8959a26ca8f5"}, - {file = "ruff-0.0.192-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e054e307f53af0db530eb1f8a810edd671561b512cf17954f8842bf7d786153b"}, - {file = "ruff-0.0.192-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:340ea45b619a6729e518658bbd11b3650d1de89f87e01334d36f8f22c454fe89"}, - {file = "ruff-0.0.192-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:a6b6863dcbac58666b87b840fd92a49a8791ee9c52bca2cc33e480380e6bf50d"}, - {file = "ruff-0.0.192-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8661c278c6a9dd059e1327d1f4b9ea1e749da6e26b77e567f1566d31d561868a"}, - {file = "ruff-0.0.192-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:51ffca9d10f139932479c5ca3838b5194ccef534677969e21b368daee5e13bca"}, - {file = "ruff-0.0.192-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03921ceae167be1733be9b50774627a3a5874e0d0db6d0f3d22cb7d4ec0bc50d"}, - {file = "ruff-0.0.192-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:e41e8492413b17451eb5ffee07339dbbd6c7b89a6c968b4fcb7f1188505f418a"}, - {file = "ruff-0.0.192-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:de4a29092aa026a484e174acb1ddc92c752836daebd4fb6d94078986531a2f4d"}, - {file = "ruff-0.0.192-py3-none-musllinux_1_2_i686.whl", hash = "sha256:6623a936cfc2547a9abbb888c9d5ffcae06897306b2649c4700a2f33bd08ada6"}, - {file = "ruff-0.0.192-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:6bd9410f10fa3efbf34ef45afae8064c7e8fddcc3ea0c1755f4e2d12c0a197e5"}, - {file = "ruff-0.0.192-py3-none-win32.whl", hash = "sha256:c3f79b3469b28961ea1737de1b2aa0e001c0f0d16fa17ead8fcfa7b9fbcd25d1"}, - {file = "ruff-0.0.192-py3-none-win_amd64.whl", hash = "sha256:fb60b2ecba8e59ad553ba003dd529e716e1eef5cd660f1f94466765f57d60c17"}, - {file = "ruff-0.0.192.tar.gz", hash = "sha256:a7ecadd76b938c3b05f74d4223fa7cf443563086cbdfae2189220c3be0bde648"}, + {file = "ruff-0.0.193-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:9206f0e613c40094c7bc21f67edc0e4278f0c28a242b5842f8c0b122defa46d2"}, + {file = "ruff-0.0.193-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:3ee66a0051dc31ffeb1b59cb020f82e1c362663ba37dfb061b9232e4153ee935"}, + {file = "ruff-0.0.193-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:62c7c1447eff6431a51fc25e2f6720d3d8b81a40f414352d113f28ce70d52469"}, + {file = "ruff-0.0.193-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8fc164a9ffcce6e0ce85f952919dc614d93d8ab63df5511f53842272499698ac"}, + {file = "ruff-0.0.193-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4319a3dc670d5f44d94db5bf5e12b00c5130e9d2c492f38f99b02c51f695a6d5"}, + {file = "ruff-0.0.193-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:36c34e5158b3f3759ae69ff2aedb7cd10c8a9cb556d690ad18752dcdff4ead98"}, + {file = "ruff-0.0.193-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4cde4b16e2ef3fe514b1c41c6726c7402d1d5a689e5b1d011ba181f21a706e4c"}, + {file = "ruff-0.0.193-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2e2810d882c628d2caf163dd4b641dca83cb35a03400faa56077fac37235aca6"}, + {file = "ruff-0.0.193-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e547bec229d55ddfe113582929864d7a6281a582cc96434f3e11bf33e6c2fb73"}, + {file = "ruff-0.0.193-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:660bde0e557ac85a09e1be98104701a407095cb3d4efd8552724b628a66d2172"}, + {file = "ruff-0.0.193-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:d27b30ab4275318580c435d218c7e5828d4d47da3f79d01e8a43894b1dd9cd72"}, + {file = "ruff-0.0.193-py3-none-musllinux_1_2_i686.whl", hash = "sha256:2336ce3742dac5d3d8b23b934c49262a7887c1531a253ed2659ebc83efdc45fa"}, + {file = "ruff-0.0.193-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:034e668b4d143d1db90bce8dd3963a9b13dd9994338d5d3338a0a8bac175a767"}, + {file = "ruff-0.0.193-py3-none-win32.whl", hash = "sha256:49a54da735d5dd25744a08266dbbebe7679e03245d03a26a59bbd26e58d1b8ce"}, + {file = "ruff-0.0.193-py3-none-win_amd64.whl", hash = "sha256:dc6252016c5057e4bf593242ae53bbefc6e65f8914b1a54aedb2a4a9cae2aceb"}, + {file = "ruff-0.0.193.tar.gz", hash = "sha256:269068501ae1074ed73fc8d36614f0d8690eaa4469f1d658f3b65b8d420c7d71"}, ] [[package]]