From 4e565fab0f5b46a54e0dfc8d4c0e3bab57bfede9 Mon Sep 17 00:00:00 2001 From: kagami Date: Fri, 8 Dec 2023 18:04:16 +0800 Subject: [PATCH] Add dev dependency and shortcuts --- Makefile | 20 ++++++++++++++++++++ pyproject.toml | 5 +++++ requirements-dev.txt | 1 + 3 files changed, 26 insertions(+) create mode 100644 Makefile create mode 100644 pyproject.toml create mode 100644 requirements-dev.txt diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6ad9af6 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +div = $(shell printf '=%.0s' {1..120}) + +setup-dev: + @echo "Setting up development environment..." + @echo "Installing dev dependencies..." + @~/.chat/mamba/envs/devchat-commands/bin/pip install -r requirements-dev.txt + @echo "Done!" + +check: + @echo ${div} + ~/.chat/mamba/envs/devchat-commands/bin/python -m ruff check . + ~/.chat/mamba/envs/devchat-commands/bin/python -m ruff format . --check + @echo "Done!" + +fix: + @echo ${div} + ~/.chat/mamba/envs/devchat-commands/bin/python -m ruff format . + @echo ${div} + ~/.chat/mamba/envs/devchat-commands/bin/python -m ruff check . --fix + @echo "Done!" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..97f6efc --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,5 @@ +[tool.ruff] +line-length = 100 + +[tool.ruff.lint] +extend-select = ["E501"] # explicitly adding the rules \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..d2aa615 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1 @@ +ruff~=0.1.7