Skip to content

Instantly share code, notes, and snippets.

@wakemaster39
Last active May 18, 2022 14:08
Show Gist options
  • Save wakemaster39/045900922bb5f946717abaf368bc1e79 to your computer and use it in GitHub Desktop.
Save wakemaster39/045900922bb5f946717abaf368bc1e79 to your computer and use it in GitHub Desktop.
nitpick configuration for python
[".editorconfig"]
root = true
[".editorconfig"."*"]
indent_style = "space"
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = "lf"
charset = "utf-8"
[".editorconfig"."*.py"]
max_line_length = 120
[".editorconfig".Jenkinsfile]
indent_size = 2
[".editorconfig"."*.{yml,yaml}"]
indent_size = 2
[".editorconfig"."*.toml"]
indent_size = 2
["mypy.ini".mypy]
python_version="3.10"
platform= "linux"
follow_imports= "normal"
ignore_missing_imports=true
# be strict
warn_return_any=true
strict_optional=true
warn_no_return=true
warn_redundant_casts=true
warn_unused_ignores=true
# The following are off by default. Flip them on if you feel
# adventurous.
disallow_untyped_defs=true
check_untyped_defs=true
["mypy.ini"."mypy-tests.*"]
disallow_any_generics=false
strict_optional=false
["pyproject.toml".tool.black]
line-length = 120
target-version = ['py310']
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.mypy_cache
| \.pytest_cache
| \.idea
| \.vscode
| \.venv
| build
| dist
)/
'''
["pyproject.toml".tool.isort]
profile="black"
line_length=120
["pyproject.toml".tool.poetry.dependencies]
python = "^3.10"
["pyproject.toml".tool.poetry.dev-dependencies]
pytest = "^6.0"
pytest-cov = "^2.10"
pytest-mock = "^3.3"
flake8 = "^3.8"
flake8-bugbear = "^21.9"
flake8-comprehensions = "^3.2.3"
flake8-isort = "^4.0.0"
flake8-eradicate = "^1.1.0"
flake8-pytest-style = "^1.3.0"
flake8-use-fstring = "^1.1"
flake8-mutable = "^1.2.0"
isort = "^5.3"
pre-commit = "^2.7"
mypy = "^0.950"
black = "^22.3.0"
yesqa = "^1.2.3"
flake8-blind-except = "^0.2.0"
flake8-debugger = "^4.0.0"
["pyproject.toml".build-system]
requires = ["poetry_core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[["pre-commit-config.yaml".repos]]
yaml = """
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: no-commit-to-branch
- id: check-merge-conflict
- id: check-toml
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
hooks:
- id: pyupgrade
args:
- --py310-plus
- --keep-runtime-typing
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
additional_dependencies:
- toml
- repo: https://github.com/myint/autoflake.git
rev: v1.4
hooks:
- id: autoflake
args:
- --in-place
- --remove-all-unused-imports
- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
- id: black
language_version: python3.10
- repo: https://github.com/adrienverge/yamllint
rev: v1.26.3
hooks:
- id: yamllint
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v8.0.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ['@commitlint/config-conventional']
- repo: https://github.com/andreoliwa/nitpick
rev: v0.32.0
hooks:
- id: nitpick
- repo: https://gitlab.com/pycqa/flake8
rev: '3.9.2'
hooks:
- id: flake8
additional_dependencies:
- flake8-blind-except
- flake8-bugbear
- flake8-comprehensions
- flake8-debugger
- flake8-isort
- flake8-pytest-style
- flake8-eradicate
- flake8-use-fstring
- flake8-mutable
- yesqa
"""
[".flake8".flake8]
max-line-length = 120
max-complexity = 12
pytest-parametrize-values-type = "tuple"
ignore = "E501,B950,FS003, B306, W503, E231, E203"
exclude = "dist, build, .venv"
@IceN9ne
Copy link

IceN9ne commented Oct 14, 2020

mypy released 0.790

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment