Skip to content

Commit

Permalink
pyright init
Browse files Browse the repository at this point in the history
  • Loading branch information
Eitan Turok committed Aug 1, 2024
1 parent 9d4b5f3 commit da015b5
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 9 deletions.
28 changes: 19 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
default_language_version:
python: python3
repos:
- repo: local
hooks:
- id: pyright
name: pyright
entry: pyright
language: node
types: [python]
pass_filenames: false
args: [--warnings]
additional_dependencies: ["[email protected]"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.2
hooks:
Expand All @@ -21,15 +31,15 @@ repos:
types: [python]
additional_dependencies:
- toml
- repo: https://github.com/pycqa/isort
hooks:
- id: isort
rev: 5.12.0
- repo: https://github.com/hadialqattan/pycln
rev: v2.1.2
hooks:
- id: pycln
args: [. --all]
- repo: https://github.com/pycqa/isort
hooks:
- id: isort
rev: 5.12.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
Expand Down Expand Up @@ -71,6 +81,11 @@ repos:
- "#"
- --allow-past-years
types: [python]
- repo: https://github.com/PyCQA/docformatter
rev: v1.5.0
hooks:
- id: docformatter
args: [--in-place, --wrap-summaries=120, --wrap-descriptions=120]
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.1.1
hooks:
Expand All @@ -82,11 +97,6 @@ repos:
exclude: (.ci|.github)
additional_dependencies:
- toml
- repo: https://github.com/PyCQA/docformatter
rev: v1.5.0
hooks:
- id: docformatter
args: [--in-place, --wrap-summaries=120, --wrap-descriptions=120]
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.28.0
hooks:
Expand Down
38 changes: 38 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -489,3 +489,41 @@ ignore_patterns = [
convention="google"
add_ignore="D100,D101,D102,D103,D104,D105,D107,D400,D401,D415"
add_select="D404"


# Pyright
[tool.pyright]
exclude = ['env-**', 'venv*', '.venv', 'tests/*', '**benchmark']
stubPath = "" # suppress useless 'stubPath is not a valid directory' errors

reportUnnecessaryIsInstance = "none" # it is ok to do this for clarity or safety
reportMissingTypeStubs = "none"
reportIncompatibleMethodOverride = "none"
reportIncompatibleVariableOverride = "error"
reportUnusedImport = "error"
reportUnusedClass = "warning"
reportUnusedFunction = "warning"
reportUnusedVariable = "error"
reportDuplicateImport = "error"
reportWildcardImportFromLibrary = "error"
reportUntypedFunctionDecorator = "warning"
reportPrivateImportUsage = "none"
reportUndefinedVariable = "error"
strictParameterNoneValue = true
reportPropertyTypeMismatch = "error"
reportUntypedNamedTuple = "error"
reportUnnecessaryCast = "error"
reportInvalidTypeVarUse = "error"
reportOverlappingOverload = "error"
reportUninitializedInstanceVariable = "error"
reportInvalidStringEscapeSequence = "error"
reportMissingParameterType = "error"
reportCallInDefaultInitializer = "error"
reportUnnecessaryComparison = "error"
reportSelfClsParameterName = "error"
reportImplicitStringConcatenation = "warning" # TODO: make this an error
reportInvalidStubStatement = "error"
reportIncompleteStub = "error"
reportUnsupportedDunderAll = "error"
reportUnusedCoroutine = "error"
reportMissingImports = "none"

0 comments on commit da015b5

Please sign in to comment.