@gspothq/cli 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -2
- package/configurations/database/postgres/manifest.toml +114 -0
- package/configurations/database/postgres/rules/POSTGRES.md +78 -0
- package/configurations/framework/astro/eslint-presets.json +138 -0
- package/configurations/framework/astro/manifest.toml +95 -0
- package/configurations/framework/astro/rules/ASTRO.md +39 -0
- package/configurations/framework/expo/manifest.toml +43 -0
- package/configurations/framework/express/manifest.toml +17 -0
- package/configurations/framework/express/rules/EXPRESS.md +73 -0
- package/configurations/framework/express/semgrep/express.yml +71 -0
- package/configurations/framework/fastapi/manifest.toml +11 -0
- package/configurations/framework/fastapi/rules/FASTAPI.md +100 -0
- package/configurations/framework/fastapi/semgrep/fastapi.yml +44 -0
- package/configurations/framework/nestjs/eslint-presets.json +62 -0
- package/configurations/framework/nestjs/manifest.toml +52 -0
- package/configurations/framework/nestjs/rules/NESTJS.md +44 -0
- package/configurations/framework/nextjs/eslint-presets.json +73 -0
- package/configurations/framework/nextjs/manifest.toml +119 -0
- package/configurations/framework/nextjs/rules/NEXTJS.md +43 -0
- package/configurations/framework/react/eslint-presets.json +77 -0
- package/configurations/framework/react/manifest.toml +93 -0
- package/configurations/framework/react/rules/REACT.md +108 -0
- package/configurations/framework/react-dom/eslint-presets.json +110 -0
- package/configurations/framework/react-dom/manifest.toml +24 -0
- package/configurations/framework/react-native/manifest.toml +46 -0
- package/configurations/framework/react-native/rules/REACT-NATIVE.md +51 -0
- package/configurations/framework/site/manifest.toml +170 -0
- package/configurations/framework/site/rules/SITE.md +20 -0
- package/configurations/framework/svelte/eslint-presets.json +67 -0
- package/configurations/framework/svelte/manifest.toml +83 -0
- package/configurations/framework/svelte/rules/SVELTE.md +48 -0
- package/configurations/framework/vue/eslint-presets.json +180 -0
- package/configurations/framework/vue/manifest.toml +83 -0
- package/configurations/framework/vue/rules/VUE.md +41 -0
- package/configurations/general/commits/manifest.toml +111 -0
- package/configurations/general/commits/rules/GIT.md +31 -0
- package/configurations/general/coverage/manifest.toml +3 -0
- package/configurations/general/dependencies/manifest.toml +159 -0
- package/configurations/general/dependencies/rules/DEPENDENCIES.md +30 -0
- package/configurations/general/dependencies/syncpack.json +15 -0
- package/configurations/general/docs/manifest.toml +79 -0
- package/configurations/general/docs/rules/DOCS.md +86 -0
- package/configurations/general/duplication/manifest.toml +32 -0
- package/configurations/general/engineering/manifest.toml +8 -0
- package/configurations/general/engineering/rules/agent/PLANNING.md +42 -0
- package/configurations/general/engineering/rules/agent/SUPPRESSIONS.md +16 -0
- package/configurations/general/engineering/rules/agent/TALKING.md +3 -0
- package/configurations/general/engineering/rules/agent/TASKS.md +19 -0
- package/configurations/general/engineering/rules/agent/WORKING.md +83 -0
- package/configurations/general/engineering/rules/code/ACCESSIBILITY.md +32 -0
- package/configurations/general/engineering/rules/code/CLI.md +37 -0
- package/configurations/general/engineering/rules/code/COMMENTS.md +38 -0
- package/configurations/general/engineering/rules/code/CONFIGURATION.md +25 -0
- package/configurations/general/engineering/rules/code/ERRORS.md +49 -0
- package/configurations/general/engineering/rules/code/HTTP.md +46 -0
- package/configurations/general/engineering/rules/code/LOGGING.md +55 -0
- package/configurations/general/engineering/rules/code/TESTING.md +58 -0
- package/configurations/general/files/manifest.toml +141 -0
- package/configurations/general/files/rules/YAML.md +19 -0
- package/configurations/general/format/manifest.toml +152 -0
- package/configurations/general/gspot/manifest.toml +65 -0
- package/configurations/general/gspot/rules/GENERATED.md +10 -0
- package/configurations/general/licenses/manifest.toml +33 -0
- package/configurations/general/naming/defaults.json +423 -0
- package/configurations/general/naming/manifest.toml +35 -0
- package/configurations/general/naming/rules/NAMING.md +179 -0
- package/configurations/general/prose/manifest.toml +86 -0
- package/configurations/general/prose/rules/WRITING.md +31 -0
- package/configurations/general/prose/vale/styles/LICENSES.md +55 -0
- package/configurations/general/prose/vale/styles/gspot/ampm.yml +8 -0
- package/configurations/general/prose/vale/styles/gspot/conscious-language.yml +16 -0
- package/configurations/general/prose/vale/styles/gspot/contractions.yml +43 -0
- package/configurations/general/prose/vale/styles/gspot/currency.yml +8 -0
- package/configurations/general/prose/vale/styles/gspot/dashes.yml +8 -0
- package/configurations/general/prose/vale/styles/gspot/date-ordinals.yml +41 -0
- package/configurations/general/prose/vale/styles/gspot/dates.yml +7 -0
- package/configurations/general/prose/vale/styles/gspot/file-paths.yml +7 -0
- package/configurations/general/prose/vale/styles/gspot/future.yml +17 -0
- package/configurations/general/prose/vale/styles/gspot/hedging.yml +22 -0
- package/configurations/general/prose/vale/styles/gspot/history.yml +16 -0
- package/configurations/general/prose/vale/styles/gspot/idioms.yml +21 -0
- package/configurations/general/prose/vale/styles/gspot/interface-verbs.yml +11 -0
- package/configurations/general/prose/vale/styles/gspot/jargon.yml +11 -0
- package/configurations/general/prose/vale/styles/gspot/leading-conjunctions.yml +12 -0
- package/configurations/general/prose/vale/styles/gspot/link-text.yml +8 -0
- package/configurations/general/prose/vale/styles/gspot/locations.yml +14 -0
- package/configurations/general/prose/vale/styles/gspot/marketing.yml +26 -0
- package/configurations/general/prose/vale/styles/gspot/merge-conflict-markers.yml +13 -0
- package/configurations/general/prose/vale/styles/gspot/militaristic-language.yml +22 -0
- package/configurations/general/prose/vale/styles/gspot/modals.yml +9 -0
- package/configurations/general/prose/vale/styles/gspot/numbered-units.yml +18 -0
- package/configurations/general/prose/vale/styles/gspot/obvious-fields.yml +14 -0
- package/configurations/general/prose/vale/styles/gspot/ordinal-adverbs.yml +15 -0
- package/configurations/general/prose/vale/styles/gspot/percentage-numbers.yml +8 -0
- package/configurations/general/prose/vale/styles/gspot/placeholders.yml +7 -0
- package/configurations/general/prose/vale/styles/gspot/product-centric-writing.yml +8 -0
- package/configurations/general/prose/vale/styles/gspot/punctuated-headings.yml +11 -0
- package/configurations/general/prose/vale/styles/gspot/self-reference.yml +15 -0
- package/configurations/general/prose/vale/styles/gspot/session-identifiers.yml +11 -0
- package/configurations/general/prose/vale/styles/gspot/since.yml +6 -0
- package/configurations/general/prose/vale/styles/gspot/straight-quotes.yml +11 -0
- package/configurations/general/prose/vale/styles/gspot/suspended-hyphens.yml +8 -0
- package/configurations/general/prose/vale/styles/gspot/symbols.yml +8 -0
- package/configurations/general/prose/vale/styles/gspot/time-ranges.yml +14 -0
- package/configurations/general/prose/vale/styles/gspot/url-prepositions.yml +10 -0
- package/configurations/general/prose/vale/styles/gspot/version-range.yml +8 -0
- package/configurations/general/repository/manifest.toml +24 -0
- package/configurations/general/secrets/gitleaks.toml +2 -0
- package/configurations/general/secrets/manifest.toml +125 -0
- package/configurations/general/secrets/rules/SECRETS.md +13 -0
- package/configurations/general/security/manifest.toml +77 -0
- package/configurations/general/security/rules/SECURITY.md +55 -0
- package/configurations/general/spelling/manifest.toml +46 -0
- package/configurations/general/structure/manifest.toml +70 -0
- package/configurations/infrastructure/ansible/manifest.toml +33 -0
- package/configurations/infrastructure/docker/manifest.toml +127 -0
- package/configurations/infrastructure/docker/rules/DOCKER.md +135 -0
- package/configurations/infrastructure/docker/trivyignore +2 -0
- package/configurations/infrastructure/github-actions/manifest.toml +76 -0
- package/configurations/infrastructure/github-actions/rules/GITHUB-ACTIONS.md +43 -0
- package/configurations/infrastructure/github-actions/zizmor.yml +3 -0
- package/configurations/infrastructure/nginx/manifest.toml +51 -0
- package/configurations/infrastructure/nginx/rules/NGINX.md +38 -0
- package/configurations/infrastructure/openapi/manifest.toml +50 -0
- package/configurations/infrastructure/openapi/rules/OPENAPI.md +39 -0
- package/configurations/infrastructure/xcode/manifest.toml +131 -0
- package/configurations/infrastructure/xcode/rules/XCODE.md +34 -0
- package/configurations/language/bash/manifest.toml +261 -0
- package/configurations/language/bash/rules/BASH.md +106 -0
- package/configurations/language/bash/rules/LANGUAGE.md +213 -0
- package/configurations/language/bash/rules/NAMING.md +62 -0
- package/configurations/language/bash/rules/OPERATIONS.md +77 -0
- package/configurations/language/bash/rules/SAFETY.md +222 -0
- package/configurations/language/bash/semgrep/bash.yml +30 -0
- package/configurations/language/css/manifest.toml +98 -0
- package/configurations/language/css/rules/CSS.md +28 -0
- package/configurations/language/css/rules/NAMING.md +17 -0
- package/configurations/language/css/rules/TAILWIND.md +26 -0
- package/configurations/language/css/stylelint-rule-names.json +89 -0
- package/configurations/language/html/manifest.toml +59 -0
- package/configurations/language/html/rules/HTML.md +27 -0
- package/configurations/language/html/rules/NAMING.md +16 -0
- package/configurations/language/javascript/eslint-presets.json +997 -0
- package/configurations/language/javascript/eslint-rule-names.json +299 -0
- package/configurations/language/javascript/eslint-runtime-names.json +61 -0
- package/configurations/language/javascript/manifest.toml +393 -0
- package/configurations/language/javascript/rules/BUN.md +13 -0
- package/configurations/language/javascript/rules/COMPONENTS.md +18 -0
- package/configurations/language/javascript/rules/DENO.md +15 -0
- package/configurations/language/javascript/rules/JAVASCRIPT.md +60 -0
- package/configurations/language/javascript/rules/NAMING.md +31 -0
- package/configurations/language/javascript/rules/NODE.md +21 -0
- package/configurations/language/javascript/rules/PLAYWRIGHT.md +34 -0
- package/configurations/language/javascript/semgrep/javascript.yml +84 -0
- package/configurations/language/markdown/manifest.toml +85 -0
- package/configurations/language/markdown/markdownlint-cli2.mjs +19 -0
- package/configurations/language/python/manifest.toml +621 -0
- package/configurations/language/python/rules/DESIGN.md +136 -0
- package/configurations/language/python/rules/FLOW.md +124 -0
- package/configurations/language/python/rules/NAMING.md +53 -0
- package/configurations/language/python/rules/PACKAGING.md +49 -0
- package/configurations/language/python/rules/PYTHON.md +136 -0
- package/configurations/language/python/rules/TYPING.md +132 -0
- package/configurations/language/sql/manifest.toml +68 -0
- package/configurations/language/sql/rules/NAMING.md +90 -0
- package/configurations/language/sql/rules/SQL.md +9 -0
- package/configurations/language/swift/manifest.toml +164 -0
- package/configurations/language/swift/rules/NAMING.md +88 -0
- package/configurations/language/swift/rules/SWIFT.md +134 -0
- package/configurations/language/swift/rules/SWIFTUI.md +61 -0
- package/configurations/language/swift/rules/UIKIT.md +99 -0
- package/configurations/language/swift/semgrep/swift.yml +126 -0
- package/configurations/language/typescript/eslint-presets.json +215 -0
- package/configurations/language/typescript/manifest.toml +72 -0
- package/configurations/language/typescript/rules/NAMING.md +73 -0
- package/configurations/language/typescript/rules/TYPESCRIPT.md +79 -0
- package/configurations/library/drizzle/manifest.toml +68 -0
- package/configurations/library/drizzle/rules/DRIZZLE.md +44 -0
- package/configurations/library/react-hook-form/manifest.toml +15 -0
- package/configurations/library/react-hook-form/rules/REACT-HOOK-FORM.md +48 -0
- package/configurations/library/swift-snapshot-testing/manifest.toml +32 -0
- package/configurations/library/tanstack-query/eslint-presets.json +21 -0
- package/configurations/library/tanstack-query/manifest.toml +26 -0
- package/configurations/library/tanstack-query/rules/TANSTACK-QUERY.md +41 -0
- package/configurations/library/testing-library/eslint-presets.json +191 -0
- package/configurations/library/testing-library/manifest.toml +47 -0
- package/configurations/library/translations/manifest.toml +40 -0
- package/configurations/library/translations/rules/NEXT-INTL.md +33 -0
- package/configurations/library/translations/rules/TRANSLATIONS.md +102 -0
- package/configurations/library/trpc/manifest.toml +14 -0
- package/configurations/library/trpc/rules/TRPC.md +43 -0
- package/configurations/library/zod/manifest.toml +25 -0
- package/configurations/library/zod/rules/ZOD.md +44 -0
- package/configurations/library/zustand/manifest.toml +18 -0
- package/configurations/library/zustand/rules/ZUSTAND.md +106 -0
- package/configurations/platform/cloudflare/manifest.toml +94 -0
- package/configurations/platform/cloudflare/rules/CLOUDFLARE.md +23 -0
- package/configurations/platform/cloudflare/semgrep/cloudflare.yml +12 -0
- package/configurations/platform/supabase/manifest.toml +112 -0
- package/configurations/platform/supabase/rules/SUPABASE.md +129 -0
- package/configurations/platform/supabase/semgrep/supabase.yml +60 -0
- package/configurations/testing/jest/manifest.toml +54 -0
- package/configurations/testing/pytest/manifest.toml +53 -0
- package/configurations/testing/swift-tests/manifest.toml +52 -0
- package/configurations/testing/swift-tests/rules/SWIFT-TESTS.md +79 -0
- package/configurations/testing/vitest/eslint-presets.json +22 -0
- package/configurations/testing/vitest/manifest.toml +69 -0
- package/configurations/testing/vitest/rules/VITEST.md +18 -0
- package/dist/LICENSE.md +201 -0
- package/dist/THIRD-PARTY-NOTICES.md +25 -0
- package/dist/eslint-rule-levels.json +10 -0
- package/dist/gspot.js +30740 -0
- package/dist/linkinator-program.js +65 -0
- package/dist/purgecss-program.js +51 -0
- package/dist/tool-versions.json +3 -0
- package/grammars/bash.wasm +0 -0
- package/grammars/css.wasm +0 -0
- package/grammars/html.wasm +0 -0
- package/grammars/javascript.wasm +0 -0
- package/grammars/licenses/tree-sitter-bash.txt +21 -0
- package/grammars/licenses/tree-sitter-css.txt +21 -0
- package/grammars/licenses/tree-sitter-html.txt +21 -0
- package/grammars/licenses/tree-sitter-javascript.txt +21 -0
- package/grammars/licenses/tree-sitter-python.txt +21 -0
- package/grammars/licenses/tree-sitter-swift.txt +21 -0
- package/grammars/licenses/tree-sitter-typescript.txt +21 -0
- package/grammars/python.wasm +0 -0
- package/grammars/swift.wasm +0 -0
- package/grammars/tsx.wasm +0 -0
- package/grammars/typescript.wasm +0 -0
- package/gspot.schema.json +45991 -0
- package/package.json +93 -5
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
allowed_words = ["Python", "Ruff"]
|
|
2
|
+
|
|
3
|
+
ignored_folders = [".venv", "venv"]
|
|
4
|
+
|
|
5
|
+
[configuration]
|
|
6
|
+
title = "Python"
|
|
7
|
+
suggests = []
|
|
8
|
+
description = "Python sources: Ruff for lint and layout, basedpyright for types, import contracts, docstrings that match signatures, unused dependencies, and dead code."
|
|
9
|
+
|
|
10
|
+
[detect]
|
|
11
|
+
extensions = [".py"]
|
|
12
|
+
project_files = ["pyproject.toml", "requirements*.txt", "Pipfile"]
|
|
13
|
+
shebangs = ["python", "python3"]
|
|
14
|
+
|
|
15
|
+
[files]
|
|
16
|
+
extensions = [".py", ".pyi"]
|
|
17
|
+
filenames = ["pyproject.toml", "setup.cfg", ".importlinter"]
|
|
18
|
+
|
|
19
|
+
[[tool]]
|
|
20
|
+
name = "uv"
|
|
21
|
+
version = "0.12.22"
|
|
22
|
+
mise = "uv"
|
|
23
|
+
|
|
24
|
+
[[tool]]
|
|
25
|
+
name = "ruff"
|
|
26
|
+
rule_url = "https://docs.astral.sh/ruff/rules/{rule}/"
|
|
27
|
+
suppression = { inline_marker = "#\\s*[nN][oO][qQ][aA](?=\\s|:|$)", marker = "#\\s*(?:(?:ruff|flake8):\\s*)?[nN][oO][qQ][aA](?=\\s|:|$)", reason = "#\\s*(?:(?:ruff|flake8):\\s*)?[nN][oO][qQ][aA](?=\\s|:|$)[^#]*# ?(?<reason>\\S.*)" }
|
|
28
|
+
version = "0.16.8"
|
|
29
|
+
min_version = "0.9.0"
|
|
30
|
+
mise = "ruff"
|
|
31
|
+
pypi = "ruff"
|
|
32
|
+
brew = "ruff"
|
|
33
|
+
[[tool.replace]]
|
|
34
|
+
file = "ruff.toml"
|
|
35
|
+
shared = false
|
|
36
|
+
|
|
37
|
+
[[tool.replace]]
|
|
38
|
+
file = ".ruff.toml"
|
|
39
|
+
shared = false
|
|
40
|
+
|
|
41
|
+
[[tool.replace]]
|
|
42
|
+
file = "pyproject.toml"
|
|
43
|
+
table = "tool.ruff"
|
|
44
|
+
shared = true
|
|
45
|
+
|
|
46
|
+
[[tool]]
|
|
47
|
+
name = "basedpyright"
|
|
48
|
+
suppression = { marker = "\\b(?:type|pyright): ?ignore\\b", reason = "#[^#]*# ?(?<reason>\\S.*)" }
|
|
49
|
+
version = "1.40.1"
|
|
50
|
+
min_version = "1.20.0"
|
|
51
|
+
npm = "basedpyright"
|
|
52
|
+
[[tool.replace]]
|
|
53
|
+
file = "pyrightconfig.json"
|
|
54
|
+
shared = false
|
|
55
|
+
|
|
56
|
+
[[tool.replace]]
|
|
57
|
+
file = "pyproject.toml"
|
|
58
|
+
table = "tool.basedpyright"
|
|
59
|
+
shared = true
|
|
60
|
+
|
|
61
|
+
[[tool.replace]]
|
|
62
|
+
file = "pyproject.toml"
|
|
63
|
+
table = "tool.pyright"
|
|
64
|
+
shared = true
|
|
65
|
+
|
|
66
|
+
[[tool]]
|
|
67
|
+
name = "lint-imports"
|
|
68
|
+
version = "2.15"
|
|
69
|
+
mise = "pipx:import-linter"
|
|
70
|
+
pypi = "import-linter"
|
|
71
|
+
version_pattern = "v?(\\d+\\.\\d+(?:\\.\\d+)?)"
|
|
72
|
+
|
|
73
|
+
[[tool]]
|
|
74
|
+
name = "pydoclint"
|
|
75
|
+
version = "0.9.1"
|
|
76
|
+
mise = "pipx:pydoclint"
|
|
77
|
+
pypi = "pydoclint"
|
|
78
|
+
|
|
79
|
+
[[tool]]
|
|
80
|
+
name = "deptry"
|
|
81
|
+
version = "0.25.1"
|
|
82
|
+
min_version = "0.20.0"
|
|
83
|
+
mise = "pipx:deptry"
|
|
84
|
+
pypi = "deptry"
|
|
85
|
+
|
|
86
|
+
[[tool]]
|
|
87
|
+
name = "validate-pyproject"
|
|
88
|
+
version = "0.26"
|
|
89
|
+
mise = "pipx:validate-pyproject"
|
|
90
|
+
pypi = "validate-pyproject"
|
|
91
|
+
version_pattern = "(\\d+\\.\\d+(?:\\.\\d+)?)"
|
|
92
|
+
|
|
93
|
+
[[tool_file]]
|
|
94
|
+
target = ".gspot/config/ruff.toml"
|
|
95
|
+
tool = "ruff"
|
|
96
|
+
pointer = { path = "ruff.toml", body = 'extend = "{target}"' }
|
|
97
|
+
per_scope = true
|
|
98
|
+
rule_keys = ["lint.select", "lint.ignore", "lint.per-file-ignores"]
|
|
99
|
+
|
|
100
|
+
[[tool_file]]
|
|
101
|
+
target = ".gspot/config/basedpyrightconfig.json"
|
|
102
|
+
tool = "basedpyright"
|
|
103
|
+
pointer = { path = "pyrightconfig.json", body = "{\n \"extends\": \"{target}\"\n}" }
|
|
104
|
+
per_scope = true
|
|
105
|
+
|
|
106
|
+
[[check]]
|
|
107
|
+
name = "ruff"
|
|
108
|
+
example = "The expression `eval(user_input)` reports S307 when that rule is selected. Replace dynamic evaluation with parsing and explicit operations appropriate to the input contract."
|
|
109
|
+
level = "recommended"
|
|
110
|
+
stage = "commit"
|
|
111
|
+
command = ["ruff", "check", "--no-cache", "--output-format", "json", "{files}"]
|
|
112
|
+
exit_codes = [1]
|
|
113
|
+
fix = ["ruff", "check", "--no-cache", "--fix", "--quiet", "{files}"]
|
|
114
|
+
files = { extensions = [".py", ".pyi"] }
|
|
115
|
+
output = { format = "json", fields = { file = "filename", line = "location.row", column = "location.column", rule = "code", message = "message" } }
|
|
116
|
+
summary = "Lints every Python file with the Ruff rules for the level, security rules included."
|
|
117
|
+
why = "Ruff holds the rules of a dozen older tools in one pass fast enough to run at every commit."
|
|
118
|
+
help = "Run gspot check --fix for the rules that fix themselves. Turn one rule off with gspot ignore python/ruff --rule `<code>` --reason \"`<why>`\", and add --paths to limit it."
|
|
119
|
+
|
|
120
|
+
[[check]]
|
|
121
|
+
name = "ruff-format"
|
|
122
|
+
example = "The Python assignment `value=1` differs from Ruff formatting. Format the file so the assignment becomes `value = 1`, then rerun."
|
|
123
|
+
level = "recommended"
|
|
124
|
+
stage = "commit"
|
|
125
|
+
command = [
|
|
126
|
+
"ruff",
|
|
127
|
+
"format",
|
|
128
|
+
"--no-cache",
|
|
129
|
+
"--check",
|
|
130
|
+
"--output-format",
|
|
131
|
+
"concise",
|
|
132
|
+
"{files}",
|
|
133
|
+
]
|
|
134
|
+
exit_codes = [1]
|
|
135
|
+
fix = ["ruff", "format", "--no-cache", "--quiet", "{files}"]
|
|
136
|
+
files = { extensions = [".py", ".pyi"] }
|
|
137
|
+
output = { format = "regex", pattern = "^(?<file>[^:]+):(?<line>\\d+):(?<column>\\d+): unformatted: ", message = "This file is not formatted the way Ruff formats it." }
|
|
138
|
+
summary = "Checks the layout of every Python file against the Ruff formatter."
|
|
139
|
+
why = "One layout everywhere keeps a diff about the change."
|
|
140
|
+
help = "Run gspot check --fix."
|
|
141
|
+
|
|
142
|
+
[[check]]
|
|
143
|
+
name = "basedpyright"
|
|
144
|
+
example = "The annotated assignment `count: int = \"one\"` reports an incompatible value type. Use `count: int = 1` when the value is a number, or correct the annotation if the contract requires text."
|
|
145
|
+
level = "recommended"
|
|
146
|
+
stage = "push"
|
|
147
|
+
runs = "scope"
|
|
148
|
+
cwd = "scope"
|
|
149
|
+
command = ["basedpyright", "--outputjson"]
|
|
150
|
+
exit_codes = [1]
|
|
151
|
+
files = { extensions = [".py", ".pyi"] }
|
|
152
|
+
output = { format = "json", items = "generalDiagnostics", line_base = 0, fields = { file = "file", line = "range.start.line", column = "range.start.character", rule = "rule", message = "message" } }
|
|
153
|
+
summary = "Type checks the project. At level `all`, it also requires annotations."
|
|
154
|
+
why = "A type error found here is a crash that never reaches a user."
|
|
155
|
+
help = "Fix the type, or narrow it where the value arrives. Accept a file that needs another dependency set with gspot ignore python/basedpyright --paths `<path>` --reason \"`<why>`\"."
|
|
156
|
+
|
|
157
|
+
[[check]]
|
|
158
|
+
name = "import-linter"
|
|
159
|
+
example = "A module importing from a layer forbidden by the configured import contract reports that dependency. Move the shared behavior to an allowed owner and update the import, then rerun against the same contract."
|
|
160
|
+
level = "recommended"
|
|
161
|
+
stage = "commit"
|
|
162
|
+
runs = "scope"
|
|
163
|
+
cwd = "scope"
|
|
164
|
+
tool = ["uv", "lint-imports"]
|
|
165
|
+
env = { PYTHONDONTWRITEBYTECODE = "1" }
|
|
166
|
+
files = { extensions = [
|
|
167
|
+
".py",
|
|
168
|
+
], filenames = [
|
|
169
|
+
"pyproject.toml",
|
|
170
|
+
"setup.cfg",
|
|
171
|
+
".importlinter",
|
|
172
|
+
] }
|
|
173
|
+
summary = "Runs project import contracts from setup.cfg, .importlinter, or pyproject.toml."
|
|
174
|
+
why = "A layer that imports the layer above it turns an architecture into a diagram nobody follows."
|
|
175
|
+
help = "Move the import to the side the contract allows, or change the contract."
|
|
176
|
+
|
|
177
|
+
[[check]]
|
|
178
|
+
name = "pydoclint"
|
|
179
|
+
example = "A function docstring describing parameter `name` when its signature accepts `path` reports a signature mismatch. Document `path` and its actual meaning, removing the obsolete parameter entry."
|
|
180
|
+
level = "recommended"
|
|
181
|
+
stage = "commit"
|
|
182
|
+
cwd = "scope"
|
|
183
|
+
tool = "pydoclint"
|
|
184
|
+
files = { extensions = [".py"] }
|
|
185
|
+
output = { format = "grouped", file_pattern = "^(?<file>\\S.*\\.py)$", pattern = "^\\s+(?<line>\\d+): (?<rule>DOC\\d+): (?<message>.*)$" }
|
|
186
|
+
summary = "Checks that every docstring names the arguments, the return, and the exceptions its function really has."
|
|
187
|
+
why = "A docstring that disagrees with the signature is worse than none, because people trust it."
|
|
188
|
+
help = "Bring the docstring in line with the signature."
|
|
189
|
+
|
|
190
|
+
[[check]]
|
|
191
|
+
name = "deptry"
|
|
192
|
+
example = "A module importing a third-party package absent from the project dependencies reports an undeclared dependency. Declare that dependency and update its lockfile with the project package manager, or remove the unused import."
|
|
193
|
+
level = "recommended"
|
|
194
|
+
stage = "push"
|
|
195
|
+
runs = "scope"
|
|
196
|
+
cwd = "scope"
|
|
197
|
+
tool = ["uv", "deptry"]
|
|
198
|
+
env = { PYTHONDONTWRITEBYTECODE = "1" }
|
|
199
|
+
files = { extensions = [".py"], filenames = ["pyproject.toml"] }
|
|
200
|
+
output = { format = "regex", pattern = "^(?<file>[^:]+):(?<line>\\d+):(?<column>\\d+): (?<rule>DEP\\d+) (?<message>.*)$" }
|
|
201
|
+
summary = "Compares the imports of the project with the dependencies it declares: missing, unused, and transitive ones."
|
|
202
|
+
why = "An import that works through somebody else's dependency breaks the day they drop it."
|
|
203
|
+
help = "Declare the dependency, or remove the one nothing imports. Turn one rule off with gspot ignore python/deptry --rule `<code>` --reason \"`<why>`\"."
|
|
204
|
+
|
|
205
|
+
[[check]]
|
|
206
|
+
name = "pyproject"
|
|
207
|
+
example = "The project metadata `version = 7` in `pyproject.toml` reports an invalid version value. Use a valid version string, such as `version = \"1.0.0\"`, and rerun before updating the lockfile."
|
|
208
|
+
level = "recommended"
|
|
209
|
+
stage = "commit"
|
|
210
|
+
command = ["validate-pyproject", "{file}"]
|
|
211
|
+
exit_codes = [1]
|
|
212
|
+
files = { filenames = ["pyproject.toml"] }
|
|
213
|
+
tool = "validate-pyproject"
|
|
214
|
+
output = { format = "regex", pattern = "^\\[ERROR\\] (?<message>.*)$" }
|
|
215
|
+
summary = "Validates every pyproject.toml against the packaging schemas."
|
|
216
|
+
why = "A key the build backend does not know is ignored without a word."
|
|
217
|
+
help = "Correct the key the message names."
|
|
218
|
+
|
|
219
|
+
[[check]]
|
|
220
|
+
name = "pip-installs"
|
|
221
|
+
example = "A `requirements.txt` written by hand beside a locked Python project creates a second dependency owner. Export that file from the lockfile, declare it generated, and use the locked installation command."
|
|
222
|
+
level = "all"
|
|
223
|
+
stage = "commit"
|
|
224
|
+
runs = "scope"
|
|
225
|
+
files = { filenames = [
|
|
226
|
+
"uv.lock",
|
|
227
|
+
"poetry.lock",
|
|
228
|
+
"pdm.lock",
|
|
229
|
+
], kinds = [
|
|
230
|
+
"source",
|
|
231
|
+
"generated",
|
|
232
|
+
] }
|
|
233
|
+
summary = "Checks that pyproject.toml lists every dependency: no hand-kept requirements file and no pip install. To accept one file, ignore its finding with gspot ignore."
|
|
234
|
+
why = "Two owners of the dependency list drift apart, and the image installs what the lockfile never saw."
|
|
235
|
+
help = "Export the requirements file from the lockfile and declare it generated, and replace pip install with the locked install. Accept a reviewed path with gspot ignore python/pip-installs --paths `<glob>` --reason \"`<why>`\"."
|
|
236
|
+
|
|
237
|
+
[[check]]
|
|
238
|
+
name = "function-size"
|
|
239
|
+
example = "A Python function exceeding the configured code-line ceiling reports a length finding. Extract a distinct operation with its own responsibility and verify the remaining function and extracted operation."
|
|
240
|
+
level = "all"
|
|
241
|
+
stage = "commit"
|
|
242
|
+
runs = "scope"
|
|
243
|
+
files = { extensions = [".py"] }
|
|
244
|
+
summary = "Checks that no Python function has more code lines than the ceiling."
|
|
245
|
+
why = "A function that fills a screen does several things, and a reader has to hold all of them."
|
|
246
|
+
help = "Move one job of the function into a function of its own."
|
|
247
|
+
|
|
248
|
+
[[check]]
|
|
249
|
+
name = "placeholder-docstrings"
|
|
250
|
+
example = "A function whose docstring merely repeats its name reports a placeholder description. Replace the docstring with the behavior, inputs, and consequential effects that the name does not explain."
|
|
251
|
+
level = "all"
|
|
252
|
+
stage = "commit"
|
|
253
|
+
runs = "scope"
|
|
254
|
+
files = { extensions = [".py"] }
|
|
255
|
+
summary = "Finds docstrings that hold a placeholder word, or the name of the function again."
|
|
256
|
+
why = "A docstring that says nothing passes the docstring rule and wastes the line."
|
|
257
|
+
help = "Say what the function does that its name does not, or for whom it exists."
|
|
258
|
+
|
|
259
|
+
[[check]]
|
|
260
|
+
name = "private-prefix"
|
|
261
|
+
example = "A file-local function with no leading underscore and no public export reports a naming finding. Add the underscore and update its local callers, or declare the actual public contract in the export list."
|
|
262
|
+
level = "all"
|
|
263
|
+
stage = "commit"
|
|
264
|
+
runs = "scope"
|
|
265
|
+
files = { extensions = [".py"] }
|
|
266
|
+
summary = "In a module with an export list, checks that every other definition starts with an underscore, and that the list holds no such name."
|
|
267
|
+
why = "A name that is public by accident gets imported, and then it cannot change."
|
|
268
|
+
help = "Add the underscore, or list the name in the export list."
|
|
269
|
+
|
|
270
|
+
[[check]]
|
|
271
|
+
name = "exports-at-bottom"
|
|
272
|
+
example = "A module with `__all__` before later declarations reports an export-list position finding. Move the export list after those declarations."
|
|
273
|
+
level = "all"
|
|
274
|
+
stage = "commit"
|
|
275
|
+
runs = "scope"
|
|
276
|
+
files = { extensions = [".py"] }
|
|
277
|
+
summary = "Checks that the export list is the last statement of its module."
|
|
278
|
+
why = "A reader looks for the public surface in one place."
|
|
279
|
+
help = "Move the export list to the end of the module."
|
|
280
|
+
|
|
281
|
+
[[check]]
|
|
282
|
+
name = "module-getattr"
|
|
283
|
+
example = "A package exposing names through module-level `__getattr__` reports lazy exports. Import the intended public names explicitly and list them in `__all__`."
|
|
284
|
+
level = "all"
|
|
285
|
+
stage = "commit"
|
|
286
|
+
runs = "scope"
|
|
287
|
+
files = { extensions = [".py"] }
|
|
288
|
+
summary = "Finds a module-level `__getattr__`."
|
|
289
|
+
why = "A name that appears only at run time hides from the type checker, the editor, and the reader."
|
|
290
|
+
help = "Import the names and list them."
|
|
291
|
+
|
|
292
|
+
[[check]]
|
|
293
|
+
name = "package-exports"
|
|
294
|
+
example = "A package export list larger than its configured limit reports the export count. Split unrelated public responsibilities into separate packages or remove unnecessary exports and update consumers."
|
|
295
|
+
level = "all"
|
|
296
|
+
stage = "commit"
|
|
297
|
+
runs = "scope"
|
|
298
|
+
files = { extensions = [".py"] }
|
|
299
|
+
summary = "Checks that a package exports no more names than the ceiling."
|
|
300
|
+
why = "A package that exports everything has no surface, so every change to it is a breaking one."
|
|
301
|
+
help = "Split the package, or export fewer names."
|
|
302
|
+
|
|
303
|
+
[[check]]
|
|
304
|
+
name = "export-order"
|
|
305
|
+
example = "An `__all__` list whose names are not ordered shortest first reports the sorted order. Reorder the list."
|
|
306
|
+
level = "all"
|
|
307
|
+
stage = "commit"
|
|
308
|
+
runs = "scope"
|
|
309
|
+
files = { extensions = [".py"] }
|
|
310
|
+
summary = "Checks that the names in the export list go shortest first, alphabetically among names of one length."
|
|
311
|
+
why = "Ruff RUF022 sorts alphabetically; gspot turns it off and sorts shortest first, then alphabetically among names of one length."
|
|
312
|
+
help = "Reorder the names shortest first."
|
|
313
|
+
|
|
314
|
+
[[check]]
|
|
315
|
+
name = "singletons"
|
|
316
|
+
example = "A module-level service instance created during import reports a singleton finding when settings do not allow it. Construct it in the application entry point and pass the instance to consumers."
|
|
317
|
+
level = "all"
|
|
318
|
+
stage = "commit"
|
|
319
|
+
runs = "scope"
|
|
320
|
+
files = { extensions = [".py"] }
|
|
321
|
+
summary = "Finds objects built at import time and kept in a module variable."
|
|
322
|
+
why = "Every importer shares the one instance, and no test gets a fresh one."
|
|
323
|
+
help = "Build the object where the program starts, and pass it in. Accept a reviewed composition file with gspot ignore python/singletons --paths `<glob>` --reason \"`<why>`\"."
|
|
324
|
+
|
|
325
|
+
[ruff_rules]
|
|
326
|
+
recommended = [
|
|
327
|
+
"A",
|
|
328
|
+
"ARG",
|
|
329
|
+
"ASYNC",
|
|
330
|
+
"B002",
|
|
331
|
+
"B003",
|
|
332
|
+
"B004",
|
|
333
|
+
"B005",
|
|
334
|
+
"B006",
|
|
335
|
+
"B007",
|
|
336
|
+
"B011",
|
|
337
|
+
"B012",
|
|
338
|
+
"B013",
|
|
339
|
+
"B014",
|
|
340
|
+
"B015",
|
|
341
|
+
"B016",
|
|
342
|
+
"B017",
|
|
343
|
+
"B019",
|
|
344
|
+
"B020",
|
|
345
|
+
"B021",
|
|
346
|
+
"B022",
|
|
347
|
+
"B023",
|
|
348
|
+
"B024",
|
|
349
|
+
"B025",
|
|
350
|
+
"B026",
|
|
351
|
+
"B027",
|
|
352
|
+
"B029",
|
|
353
|
+
"B03",
|
|
354
|
+
"B904",
|
|
355
|
+
"B91",
|
|
356
|
+
"BLE",
|
|
357
|
+
"C4",
|
|
358
|
+
"COM",
|
|
359
|
+
"DTZ",
|
|
360
|
+
"E1",
|
|
361
|
+
"E4",
|
|
362
|
+
"E70",
|
|
363
|
+
"E71",
|
|
364
|
+
"E72",
|
|
365
|
+
"E73",
|
|
366
|
+
"E9",
|
|
367
|
+
"EXE",
|
|
368
|
+
"F",
|
|
369
|
+
"FA",
|
|
370
|
+
"FLY",
|
|
371
|
+
"FURB",
|
|
372
|
+
"G",
|
|
373
|
+
"ISC",
|
|
374
|
+
"LOG",
|
|
375
|
+
"PERF",
|
|
376
|
+
"PGH",
|
|
377
|
+
"PIE",
|
|
378
|
+
"PLE",
|
|
379
|
+
"PLR01",
|
|
380
|
+
"PLR02",
|
|
381
|
+
"PLR04",
|
|
382
|
+
"PLR1708",
|
|
383
|
+
"PLR1714",
|
|
384
|
+
"PLR1716",
|
|
385
|
+
"PLR204",
|
|
386
|
+
"PLW01",
|
|
387
|
+
"PLW02",
|
|
388
|
+
"PLW04",
|
|
389
|
+
"PLW0604",
|
|
390
|
+
"PLW064",
|
|
391
|
+
"PLW07",
|
|
392
|
+
"PLW15",
|
|
393
|
+
"PLW21",
|
|
394
|
+
"PLW3",
|
|
395
|
+
"PYI",
|
|
396
|
+
"Q",
|
|
397
|
+
"RET501",
|
|
398
|
+
"RET502",
|
|
399
|
+
"RSE",
|
|
400
|
+
"RUF005",
|
|
401
|
+
"RUF006",
|
|
402
|
+
"RUF007",
|
|
403
|
+
"RUF008",
|
|
404
|
+
"RUF009",
|
|
405
|
+
"RUF010",
|
|
406
|
+
"RUF013",
|
|
407
|
+
"RUF015",
|
|
408
|
+
"RUF016",
|
|
409
|
+
"RUF017",
|
|
410
|
+
"RUF018",
|
|
411
|
+
"RUF019",
|
|
412
|
+
"RUF02",
|
|
413
|
+
"RUF03",
|
|
414
|
+
"RUF040",
|
|
415
|
+
"RUF041",
|
|
416
|
+
"RUF043",
|
|
417
|
+
"RUF048",
|
|
418
|
+
"RUF049",
|
|
419
|
+
"RUF051",
|
|
420
|
+
"RUF053",
|
|
421
|
+
"RUF057",
|
|
422
|
+
"RUF058",
|
|
423
|
+
"RUF06",
|
|
424
|
+
"RUF1",
|
|
425
|
+
"RUF2",
|
|
426
|
+
"S102",
|
|
427
|
+
"S103",
|
|
428
|
+
"S104",
|
|
429
|
+
"S105",
|
|
430
|
+
"S106",
|
|
431
|
+
"S107",
|
|
432
|
+
"S108",
|
|
433
|
+
"S11",
|
|
434
|
+
"S2",
|
|
435
|
+
"S30",
|
|
436
|
+
"S310",
|
|
437
|
+
"S312",
|
|
438
|
+
"S313",
|
|
439
|
+
"S314",
|
|
440
|
+
"S315",
|
|
441
|
+
"S316",
|
|
442
|
+
"S317",
|
|
443
|
+
"S318",
|
|
444
|
+
"S319",
|
|
445
|
+
"S32",
|
|
446
|
+
"S5",
|
|
447
|
+
"S6",
|
|
448
|
+
"S7",
|
|
449
|
+
"SIM101",
|
|
450
|
+
"SIM102",
|
|
451
|
+
"SIM103",
|
|
452
|
+
"SIM105",
|
|
453
|
+
"SIM107",
|
|
454
|
+
"SIM109",
|
|
455
|
+
"SIM110",
|
|
456
|
+
"SIM112",
|
|
457
|
+
"SIM113",
|
|
458
|
+
"SIM115",
|
|
459
|
+
"SIM118",
|
|
460
|
+
"SIM2",
|
|
461
|
+
"SIM4",
|
|
462
|
+
"SIM9",
|
|
463
|
+
"T1",
|
|
464
|
+
"UP",
|
|
465
|
+
"W",
|
|
466
|
+
"YTT",
|
|
467
|
+
]
|
|
468
|
+
all = [
|
|
469
|
+
"ANN",
|
|
470
|
+
"B008",
|
|
471
|
+
"B009",
|
|
472
|
+
"B010",
|
|
473
|
+
"B018",
|
|
474
|
+
"B028",
|
|
475
|
+
"B905",
|
|
476
|
+
"C9",
|
|
477
|
+
"D",
|
|
478
|
+
"D107",
|
|
479
|
+
"D204",
|
|
480
|
+
"D212",
|
|
481
|
+
"D214",
|
|
482
|
+
"D215",
|
|
483
|
+
"D400",
|
|
484
|
+
"D401",
|
|
485
|
+
"D402",
|
|
486
|
+
"D404",
|
|
487
|
+
"D405",
|
|
488
|
+
"D406",
|
|
489
|
+
"D407",
|
|
490
|
+
"D408",
|
|
491
|
+
"D409",
|
|
492
|
+
"D410",
|
|
493
|
+
"D411",
|
|
494
|
+
"D413",
|
|
495
|
+
"D415",
|
|
496
|
+
"D416",
|
|
497
|
+
"D417",
|
|
498
|
+
"E5",
|
|
499
|
+
"E74",
|
|
500
|
+
"EM",
|
|
501
|
+
"ERA",
|
|
502
|
+
"FBT",
|
|
503
|
+
"FIX",
|
|
504
|
+
"I",
|
|
505
|
+
"ICN",
|
|
506
|
+
"INP",
|
|
507
|
+
"N",
|
|
508
|
+
"PLC",
|
|
509
|
+
"PLR09",
|
|
510
|
+
"PLR1704",
|
|
511
|
+
"PLR1711",
|
|
512
|
+
"PLR172",
|
|
513
|
+
"PLR173",
|
|
514
|
+
"PLR200",
|
|
515
|
+
"PLR5",
|
|
516
|
+
"PLW0602",
|
|
517
|
+
"PLW0603",
|
|
518
|
+
"PLW16",
|
|
519
|
+
"PLW29",
|
|
520
|
+
"PTH",
|
|
521
|
+
"RET503",
|
|
522
|
+
"RET504",
|
|
523
|
+
"RET505",
|
|
524
|
+
"RET506",
|
|
525
|
+
"RET507",
|
|
526
|
+
"RET508",
|
|
527
|
+
"RUF001",
|
|
528
|
+
"RUF002",
|
|
529
|
+
"RUF003",
|
|
530
|
+
"RUF012",
|
|
531
|
+
"RUF046",
|
|
532
|
+
"RUF059",
|
|
533
|
+
"S101",
|
|
534
|
+
"S311",
|
|
535
|
+
"SIM108",
|
|
536
|
+
"SIM114",
|
|
537
|
+
"SIM116",
|
|
538
|
+
"SIM117",
|
|
539
|
+
"SIM3",
|
|
540
|
+
"SLF",
|
|
541
|
+
"SLOT",
|
|
542
|
+
"T2",
|
|
543
|
+
"TC",
|
|
544
|
+
"TD",
|
|
545
|
+
"TRY",
|
|
546
|
+
]
|
|
547
|
+
|
|
548
|
+
[[naming.override]]
|
|
549
|
+
paths = ["**/__init__.py", "**/__main__.py"]
|
|
550
|
+
categories = ["files"]
|
|
551
|
+
allowed_names = ["__init__", "__main__"]
|
|
552
|
+
reason = "Python names these files."
|
|
553
|
+
languages = ["python"]
|
|
554
|
+
|
|
555
|
+
[[naming.override]]
|
|
556
|
+
paths = ["**"]
|
|
557
|
+
languages = ["python"]
|
|
558
|
+
categories = ["methods"]
|
|
559
|
+
allowed_names = ["setUp", "setUpClass", "tearDown", "tearDownClass"]
|
|
560
|
+
reason = "unittest discovers its lifecycle methods by these names."
|
|
561
|
+
|
|
562
|
+
[[naming.override]]
|
|
563
|
+
paths = ["**"]
|
|
564
|
+
languages = ["python"]
|
|
565
|
+
categories = ["functions", "methods", "variables", "constants", "attributes"]
|
|
566
|
+
allowed_names = [
|
|
567
|
+
"__init__",
|
|
568
|
+
"__main__",
|
|
569
|
+
"__all__",
|
|
570
|
+
"__name__",
|
|
571
|
+
"__file__",
|
|
572
|
+
"__dict__",
|
|
573
|
+
"__slots__",
|
|
574
|
+
"__repr__",
|
|
575
|
+
"__str__",
|
|
576
|
+
"__eq__",
|
|
577
|
+
"__hash__",
|
|
578
|
+
"__len__",
|
|
579
|
+
"__iter__",
|
|
580
|
+
"__next__",
|
|
581
|
+
"__enter__",
|
|
582
|
+
"__exit__",
|
|
583
|
+
"__call__",
|
|
584
|
+
"__getitem__",
|
|
585
|
+
"__setitem__",
|
|
586
|
+
"__delitem__",
|
|
587
|
+
"__contains__",
|
|
588
|
+
"__lt__",
|
|
589
|
+
"__le__",
|
|
590
|
+
"__gt__",
|
|
591
|
+
"__ge__",
|
|
592
|
+
"__ne__",
|
|
593
|
+
"__bool__",
|
|
594
|
+
"__post_init__",
|
|
595
|
+
"__class_getitem__",
|
|
596
|
+
"__aenter__",
|
|
597
|
+
"__aexit__",
|
|
598
|
+
"__await__",
|
|
599
|
+
"__aiter__",
|
|
600
|
+
"__anext__",
|
|
601
|
+
"__new__",
|
|
602
|
+
"__spec__",
|
|
603
|
+
"__package__",
|
|
604
|
+
"__loader__",
|
|
605
|
+
"__cached__",
|
|
606
|
+
"__doc__",
|
|
607
|
+
"__annotations__",
|
|
608
|
+
"__path__",
|
|
609
|
+
"__class__",
|
|
610
|
+
"__classcell__",
|
|
611
|
+
"__qualname__",
|
|
612
|
+
"__builtins__",
|
|
613
|
+
]
|
|
614
|
+
reason = "Python defines these special methods and attributes."
|
|
615
|
+
|
|
616
|
+
[[naming.override]]
|
|
617
|
+
paths = ["**"]
|
|
618
|
+
languages = ["python"]
|
|
619
|
+
categories = ["functions", "variables", "constants", "methods", "attributes"]
|
|
620
|
+
ignored_prefix = "^_+"
|
|
621
|
+
reason = "A leading underscore marks a private Python declaration."
|