-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
806ba64
commit 3b40f5a
Showing
4 changed files
with
177 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
default_install_hook_types: | ||
- pre-commit | ||
- pre-push | ||
- commit-msg | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
# - id: check-yaml | ||
- id: end-of-file-fixer | ||
stages: [pre-commit] | ||
- id: trailing-whitespace | ||
stages: [pre-commit] | ||
- id: debug-statements | ||
stages: [pre-push] | ||
|
||
# ## Isort | ||
# - repo: https://github.com/pycqa/isort | ||
# rev: 5.12.0 | ||
# hooks: | ||
# - id: isort | ||
# name: isort | ||
# stages: [pre-commit] | ||
|
||
# ## Black | ||
# - repo: https://github.com/psf/black | ||
# rev: 23.3.0 | ||
# hooks: | ||
# - id: black | ||
# stages: [pre-commit] | ||
|
||
# ## Ruff | ||
# - repo: https://github.com/charliermarsh/ruff-pre-commit | ||
# rev: v0.0.260 | ||
# hooks: | ||
# - id: ruff | ||
# stages: [pre-commit] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,127 @@ | ||
[black] | ||
line-length = 79 | ||
[tool.towncrier] | ||
issue_format = "" | ||
directory = "changes" | ||
package = "ckanext.or_facet" | ||
package_dir = "ckanext" | ||
filename = "CHANGELOG.rst" | ||
name = "ckanext-or-facet" | ||
[tool.black] | ||
# line-length = 88 | ||
# preview = true | ||
|
||
[tool.ruff] | ||
target-version = "py38" | ||
select = [ | ||
# "B", # likely bugs and design problems | ||
# "BLE", # do not catch blind exception | ||
# "C40", # better list/set/dict comprehensions | ||
# "C90", # check McCabe complexity | ||
# "COM", # trailing commas | ||
"E", # pycodestyle error | ||
# "W", # pycodestyle warning | ||
"F", # pyflakes | ||
# "G", # format strings for logging statements | ||
# "N", # naming conventions | ||
# "PL", # pylint | ||
# "PT", # pytest style | ||
# "PIE", # misc lints | ||
# "Q", # preferred quoting style | ||
# "RET", # improvements for return statements | ||
# "RSE", # improvements for rise statements | ||
# "S", # security testing | ||
# "SIM", # simplify code | ||
# "T10", # debugging statements | ||
# "T20", # print statements | ||
# "TID", # tidier imports | ||
# "TRY", # better exceptions | ||
# "UP", # upgrade syntax for newer versions of the language | ||
] | ||
ignore = [ | ||
"E712", # comparison to bool: violated by SQLAlchemy filters | ||
"PT004", # fixture does not return anything, add leading underscore: violated by clean_db | ||
"PLC1901", # simplify comparison to empty string: violated by SQLAlchemy filters | ||
] | ||
|
||
[tool.ruff.per-file-ignores] | ||
"ckanext/or_facet/tests*" = ["S", "PL"] | ||
|
||
[tool.isort] | ||
known_ckan = "ckan" | ||
known_ckanext = "ckanext" | ||
known_self = "ckanext.or_facet" | ||
sections = "FUTURE,STDLIB,FIRSTPARTY,THIRDPARTY,CKAN,CKANEXT,SELF,LOCALFOLDER" | ||
profile = "black" | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "--ckan-ini test.ini" | ||
filterwarnings = [ | ||
"ignore::sqlalchemy.exc.SADeprecationWarning", | ||
"ignore::sqlalchemy.exc.SAWarning", | ||
"ignore::DeprecationWarning", | ||
] | ||
|
||
[tool.pyright] | ||
pythonVersion = "3.8" | ||
include = ["ckanext"] | ||
exclude = [ | ||
"**/test*", | ||
"**/migration", | ||
] | ||
strict = [] | ||
|
||
strictParameterNoneValue = true | ||
|
||
# Check the meaning of rules here | ||
# https://github.com/microsoft/pyright/blob/main/docs/configuration.md | ||
reportFunctionMemberAccess = true # non-standard member accesses for functions | ||
reportMissingImports = true | ||
reportMissingModuleSource = true | ||
reportMissingTypeStubs = false | ||
reportImportCycles = true | ||
reportUnusedImport = true | ||
reportUnusedClass = true | ||
reportUnusedFunction = true | ||
reportUnusedVariable = true | ||
reportDuplicateImport = true | ||
reportOptionalSubscript = true | ||
reportOptionalMemberAccess = true | ||
reportOptionalCall = true | ||
reportOptionalIterable = true | ||
reportOptionalContextManager = true | ||
reportOptionalOperand = true | ||
reportTypedDictNotRequiredAccess = false # Context won't work with this rule | ||
reportConstantRedefinition = true | ||
reportIncompatibleMethodOverride = true | ||
reportIncompatibleVariableOverride = true | ||
reportOverlappingOverload = true | ||
reportUntypedFunctionDecorator = false | ||
reportUnknownParameterType = true | ||
reportUnknownArgumentType = false | ||
reportUnknownLambdaType = false | ||
reportUnknownMemberType = false | ||
reportMissingTypeArgument = true | ||
reportInvalidTypeVarUse = true | ||
reportCallInDefaultInitializer = true | ||
reportUnknownVariableType = true | ||
reportUntypedBaseClass = true | ||
reportUnnecessaryIsInstance = true | ||
reportUnnecessaryCast = true | ||
reportUnnecessaryComparison = true | ||
reportAssertAlwaysTrue = true | ||
reportSelfClsParameterName = true | ||
reportUnusedCallResult = false # allow function calls for side-effect only | ||
useLibraryCodeForTypes = true | ||
reportGeneralTypeIssues = true | ||
reportPropertyTypeMismatch = true | ||
reportWildcardImportFromLibrary = true | ||
reportUntypedClassDecorator = false | ||
reportUntypedNamedTuple = true | ||
reportPrivateUsage = true | ||
reportPrivateImportUsage = true | ||
reportInconsistentConstructor = true | ||
reportMissingSuperCall = false | ||
reportUninitializedInstanceVariable = true | ||
reportInvalidStringEscapeSequence = true | ||
reportMissingParameterType = true | ||
reportImplicitStringConcatenation = false | ||
reportUndefinedVariable = true | ||
reportUnboundVariable = true | ||
reportInvalidStubStatement = true | ||
reportIncompleteStub = true | ||
reportUnsupportedDunderAll = true | ||
reportUnusedCoroutine = true | ||
reportUnnecessaryTypeIgnoreComment = true | ||
reportMatchNotExhaustive = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters