From 2a5663d973d7f826ad4777bdd0fa7c6aa02f1dec Mon Sep 17 00:00:00 2001 From: ljstella Date: Thu, 22 Aug 2024 11:20:54 -0500 Subject: [PATCH 01/19] First crack at default config --- .vscode/settings.json | 10 +++++- pyproject.toml | 79 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8a62413d..74d85aa8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,7 +4,15 @@ "python.testing.cwd": "${workspaceFolder}", "python.languageServer": "Pylance", "python.analysis.typeCheckingMode": "strict", - "editor.defaultFormatter": "ms-python.black-formatter" + "[python]": { + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll": "explicit", + "source.organizeImports": "explicit" + }, + "editor.defaultFormatter": "charliermarsh.ruff", + }, + "ruff.nativeServer": "on" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e43c8bdf..6176e4d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,3 +33,82 @@ setuptools = ">=69.5.1,<74.0.0" [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" + +[tool.ruff] +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", +] + +# Same as Black. +line-length = 88 +indent-width = 4 + +# Assume Python 3.8 +target-version = "py38" + +[tool.ruff.lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = ["E4", "E7", "E9", "F"] +ignore = [] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[tool.ruff.format] +# Like Black, use double quotes for strings. +quote-style = "double" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" + +# Enable auto-formatting of code examples in docstrings. Markdown, +# reStructuredText code/literal blocks and doctests are all supported. +# +# This is currently disabled by default, but it is planned for this +# to be opt-out in the future. +docstring-code-format = false + +# Set the line length limit used when formatting code snippets in +# docstrings. +# +# This only has an effect when the `docstring-code-format` setting is +# enabled. +docstring-code-line-length = "dynamic" \ No newline at end of file From 3f7a585bea187ac06f5be04ef662eb4df1bb3fbe Mon Sep 17 00:00:00 2001 From: ljstella Date: Thu, 22 Aug 2024 12:41:55 -0500 Subject: [PATCH 02/19] Adding suggested extension config --- .vscode/extensions.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..8d1a435f --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "charliermarsh.ruff" + ] +} \ No newline at end of file From 0a88668f3812d616ddc1ee8b854d3d4bd77420f1 Mon Sep 17 00:00:00 2001 From: ljstella Date: Fri, 30 Aug 2024 14:56:36 -0500 Subject: [PATCH 03/19] Bumping target_version --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6176e4d1..618a9ca8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,7 +70,7 @@ line-length = 88 indent-width = 4 # Assume Python 3.8 -target-version = "py38" +target-version = "py311" [tool.ruff.lint] # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. @@ -111,4 +111,4 @@ docstring-code-format = false # # This only has an effect when the `docstring-code-format` setting is # enabled. -docstring-code-line-length = "dynamic" \ No newline at end of file +docstring-code-line-length = "dynamic" From 2568f7110aeab2554c5605c1c1168f4577874020 Mon Sep 17 00:00:00 2001 From: ljstella Date: Tue, 10 Sep 2024 14:12:04 -0500 Subject: [PATCH 04/19] Updated pyproject.toml --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 56df65ee..57e8d3bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,7 +69,6 @@ exclude = [ line-length = 88 indent-width = 4 -# Assume Python 3.8 target-version = "py311" [tool.ruff.lint] From 0b4158b3f81e799a576e33943aeee34673282665 Mon Sep 17 00:00:00 2001 From: ljstella Date: Thu, 12 Sep 2024 09:18:47 -0500 Subject: [PATCH 05/19] Github CI --- .github/workflows/ruff.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/ruff.yml diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml new file mode 100644 index 00000000..6d84a781 --- /dev/null +++ b/.github/workflows/ruff.yml @@ -0,0 +1,23 @@ +name: lint & format +on: + push: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: Install ruff + run: | + python -m pip install --upgrade pip + pip install ruff + - name: Run lint + run: ruff check --output-format=github contentctl/ + - name: Run Formatter + run: ruff format --check contentctl/ \ No newline at end of file From f99655d4657a6649c043359c2df32e93bebd278a Mon Sep 17 00:00:00 2001 From: ljstella Date: Thu, 12 Sep 2024 09:24:45 -0500 Subject: [PATCH 06/19] Add precommit hook --- .pre-commit-config.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..4c0bcb35 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,16 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 # Use the ref you want to point at + hooks: + - id: check-json + - id: check-symlinks + - id: check-yaml + - id: detect-aws-credentials + - id: detect-private-key + - id: forbid-submodules + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.6.4 + hooks: + - id: ruff + args: [ --fix ] + - id: ruff-format \ No newline at end of file From c1bdfbcebde244f58a0b0cd6285d6ffd4613d20a Mon Sep 17 00:00:00 2001 From: ljstella Date: Thu, 12 Sep 2024 09:25:10 -0500 Subject: [PATCH 07/19] Update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2e4fcc96..156005c0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ poetry.lock # usual mac files .DS_Store */.DS_Store +.ruff_cache # custom dist/* From 7ed5e02a2872f00b4d5d8dd66976852dec3f46ce Mon Sep 17 00:00:00 2001 From: ljstella Date: Thu, 12 Sep 2024 09:46:09 -0500 Subject: [PATCH 08/19] Updating ruff workflow --- .github/workflows/ruff.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index 6d84a781..4843361a 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -1,6 +1,5 @@ name: lint & format on: - push: pull_request: types: [opened, reopened, synchronize] From 9aa1607fff43ffc3c2487f153f33a1b16c50d217 Mon Sep 17 00:00:00 2001 From: ljstella Date: Thu, 12 Sep 2024 10:49:43 -0500 Subject: [PATCH 09/19] Adding ruff as dev dependency --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 3c9e4f6d..001d38a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,9 @@ gitpython = "^3.1.43" setuptools = ">=69.5.1,<75.0.0" [tool.poetry.dev-dependencies] +[tool.poetry.group.dev.dependencies] +ruff = "^0.6.4" + [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" From 030ae920c49f2ea42249c4e088c87f7b1fffb3ef Mon Sep 17 00:00:00 2001 From: ljstella Date: Tue, 29 Oct 2024 09:16:53 -0500 Subject: [PATCH 10/19] bumped version --- .pre-commit-config.yaml | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c0bcb35..d8891b2a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,8 +9,8 @@ repos: - id: detect-private-key - id: forbid-submodules - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.4 + rev: v0.7.1 hooks: - id: ruff args: [ --fix ] - - id: ruff-format \ No newline at end of file + - id: ruff-format diff --git a/pyproject.toml b/pyproject.toml index ccd805c2..1a1dcb62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ setuptools = ">=69.5.1,<76.0.0" [tool.poetry.dev-dependencies] [tool.poetry.group.dev.dependencies] -ruff = "^0.6.4" +ruff = "^0.7.1" [build-system] requires = ["poetry-core>=1.0.0"] From 559195229ebfa73bdbe9ebc6f062a2c00801ad0d Mon Sep 17 00:00:00 2001 From: ljstella Date: Fri, 22 Nov 2024 11:24:06 -0600 Subject: [PATCH 11/19] Ruff version bump --- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d8891b2a..a8c73774 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: detect-private-key - id: forbid-submodules - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.1 + rev: v0.8.0 hooks: - id: ruff args: [ --fix ] diff --git a/pyproject.toml b/pyproject.toml index 745bd4ab..00f568d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ setuptools = ">=69.5.1,<76.0.0" [tool.poetry.dev-dependencies] [tool.poetry.group.dev.dependencies] -ruff = "^0.7.1" +ruff = "^0.8.0" [build-system] requires = ["poetry-core>=1.0.0"] From ed1c8b0c257b397a7cade76d3372cffb09c7345b Mon Sep 17 00:00:00 2001 From: ljstella Date: Wed, 11 Dec 2024 09:06:36 -0600 Subject: [PATCH 12/19] Version bump --- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a8c73774..85e96877 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: detect-private-key - id: forbid-submodules - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.0 + rev: v0.8.2 hooks: - id: ruff args: [ --fix ] diff --git a/pyproject.toml b/pyproject.toml index 00f568d6..05292a06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ setuptools = ">=69.5.1,<76.0.0" [tool.poetry.dev-dependencies] [tool.poetry.group.dev.dependencies] -ruff = "^0.8.0" +ruff = "^0.8.2" [build-system] requires = ["poetry-core>=1.0.0"] From c0d440c0817f4a23b9e1da21aea3dffbe3e5257c Mon Sep 17 00:00:00 2001 From: ljstella Date: Wed, 11 Dec 2024 09:38:42 -0600 Subject: [PATCH 13/19] other precommit hooks --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 85e96877..4ac592eb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 # Use the ref you want to point at + rev: v5.0.0 # Use the ref you want to point at hooks: - id: check-json - id: check-symlinks From d71674f1ddec5603def74725768f59517709fb68 Mon Sep 17 00:00:00 2001 From: ljstella Date: Thu, 19 Dec 2024 08:23:26 -0600 Subject: [PATCH 14/19] version bump --- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4ac592eb..61eb7b55 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: detect-private-key - id: forbid-submodules - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.2 + rev: v0.8.4 hooks: - id: ruff args: [ --fix ] diff --git a/pyproject.toml b/pyproject.toml index a3fd626a..7c4df1bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ setuptools = ">=69.5.1,<76.0.0" [tool.poetry.dev-dependencies] [tool.poetry.group.dev.dependencies] -ruff = "^0.8.2" +ruff = "^0.8.4" [build-system] requires = ["poetry-core>=1.0.0"] From 6aebe3fb3deee30db741001d225cc7f306cbdb19 Mon Sep 17 00:00:00 2001 From: ljstella Date: Thu, 2 Jan 2025 13:58:02 -0600 Subject: [PATCH 15/19] Version bump --- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 61eb7b55..994a349c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: detect-private-key - id: forbid-submodules - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.4 + rev: v0.8.5 hooks: - id: ruff args: [ --fix ] diff --git a/pyproject.toml b/pyproject.toml index 7c4df1bc..b8331444 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ setuptools = ">=69.5.1,<76.0.0" [tool.poetry.dev-dependencies] [tool.poetry.group.dev.dependencies] -ruff = "^0.8.4" +ruff = "^0.8.5" [build-system] requires = ["poetry-core>=1.0.0"] From 6f60e75d88e432f7a20c859ddb36bbfc31a97811 Mon Sep 17 00:00:00 2001 From: Lou Stella Date: Sun, 5 Jan 2025 16:12:24 -0600 Subject: [PATCH 16/19] version update --- .pre-commit-config.yaml | 2 +- pyproject.toml | 54 ++++++++++++++++++++--------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 994a349c..77eb04cf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: detect-private-key - id: forbid-submodules - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.5 + rev: v0.8.6 hooks: - id: ruff args: [ --fix ] diff --git a/pyproject.toml b/pyproject.toml index b8331444..d59fb265 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ setuptools = ">=69.5.1,<76.0.0" [tool.poetry.dev-dependencies] [tool.poetry.group.dev.dependencies] -ruff = "^0.8.5" +ruff = "^0.8.6" [build-system] requires = ["poetry-core>=1.0.0"] @@ -42,32 +42,32 @@ build-backend = "poetry.core.masonry.api" [tool.ruff] # Exclude a variety of commonly ignored directories. exclude = [ - ".bzr", - ".direnv", - ".eggs", - ".git", - ".git-rewrite", - ".hg", - ".ipynb_checkpoints", - ".mypy_cache", - ".nox", - ".pants.d", - ".pyenv", - ".pytest_cache", - ".pytype", - ".ruff_cache", - ".svn", - ".tox", - ".venv", - ".vscode", - "__pypackages__", - "_build", - "buck-out", - "build", - "dist", - "node_modules", - "site-packages", - "venv", + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", ] # Same as Black. From 8795e97f3402bae8b30de0e2205cefcf98ff29dc Mon Sep 17 00:00:00 2001 From: ljstella Date: Thu, 9 Jan 2025 15:26:42 -0600 Subject: [PATCH 17/19] bump to 0.9.0 --- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 77eb04cf..e49aaf16 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: detect-private-key - id: forbid-submodules - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.6 + rev: v0.9.0 hooks: - id: ruff args: [ --fix ] diff --git a/pyproject.toml b/pyproject.toml index d59fb265..264b7278 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ setuptools = ">=69.5.1,<76.0.0" [tool.poetry.dev-dependencies] [tool.poetry.group.dev.dependencies] -ruff = "^0.8.6" +ruff = "^0.9.0" [build-system] requires = ["poetry-core>=1.0.0"] From 633f0d5dc73f7040a069e77c150f7265255d3752 Mon Sep 17 00:00:00 2001 From: Lou Stella Date: Sun, 12 Jan 2025 14:29:02 -0600 Subject: [PATCH 18/19] version bump to 0.9.1 --- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e49aaf16..164a8deb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: detect-private-key - id: forbid-submodules - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.0 + rev: v0.9.1 hooks: - id: ruff args: [ --fix ] diff --git a/pyproject.toml b/pyproject.toml index 264b7278..c5d0a4b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ setuptools = ">=69.5.1,<76.0.0" [tool.poetry.dev-dependencies] [tool.poetry.group.dev.dependencies] -ruff = "^0.9.0" +ruff = "^0.9.1" [build-system] requires = ["poetry-core>=1.0.0"] From c4a88f57303d55d15ca09ac34192453836ace042 Mon Sep 17 00:00:00 2001 From: Lou Stella Date: Thu, 16 Jan 2025 20:05:12 -0600 Subject: [PATCH 19/19] Bump for 0.9.2 --- .pre-commit-config.yaml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 164a8deb..30df3046 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: detect-private-key - id: forbid-submodules - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.1 + rev: v0.9.2 hooks: - id: ruff args: [ --fix ] diff --git a/pyproject.toml b/pyproject.toml index c5d0a4b4..ad40dd17 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ setuptools = ">=69.5.1,<76.0.0" [tool.poetry.dev-dependencies] [tool.poetry.group.dev.dependencies] -ruff = "^0.9.1" +ruff = "^0.9.2" [build-system] requires = ["poetry-core>=1.0.0"]