Skip to content

Commit

Permalink
cleaned config files, pre-commit-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Feelx234 committed Jan 8, 2025
1 parent 1d3d4fc commit ccbc072
Show file tree
Hide file tree
Showing 6 changed files with 435 additions and 238 deletions.
68 changes: 68 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
exclude: '^docs/conf.py'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: mixed-line-ending
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows

## If you want to automatically "modernize" your Python code:
# - repo: https://github.com/asottile/pyupgrade
# rev: v3.7.0
# hooks:
# - id: pyupgrade
# args: ['--py37-plus']

## If you want to avoid flake8 errors due to unused vars or imports:
# - repo: https://github.com/PyCQA/autoflake
# rev: v2.1.1
# hooks:
# - id: autoflake
# args: [
# --in-place,
# --remove-all-unused-imports,
# --remove-unused-variables,
# ]

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
language_version: python3

## If like to embrace black styles even in the docs:
# - repo: https://github.com/asottile/blacken-docs
# rev: v1.13.0
# hooks:
# - id: blacken-docs
# additional_dependencies: [black]

- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies: [Flake8-pyproject]
## You can add flake8 plugins via `additional_dependencies`:
# additional_dependencies: [flake8-bugbear]

## Check for misspells in documentation files:
# - repo: https://github.com/codespell-project/codespell
# rev: v2.2.5
# hooks:
# - id: codespell
10 changes: 0 additions & 10 deletions .pylintrc

This file was deleted.

59 changes: 59 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,62 @@ omit = [
"*/multivariate_poly.py",
"*/utils_for_test.py", # Regexes for lines to exclude from consideration
]


[tool.flake8]
# Some sane defaults for the code style checker flake8
max_line_length = 125
extend_ignore = ["E203", "W503", "E741"]
# ^ Black-compatible
# E203 and W503 have edge cases handled by black
exclude = [".tox", "build", "dist", ".eggs"]


[tool.isort]
profile = "black"
known_first_party = ["microagg1d"]


[tool.pylint.basic]
# Good variable names which should always be accepted, separated by a comma.
good-names = [
"R",
"D",
"T",
"D_row",
"S",
"A",
"F",
"H",
"F_vals",
"F_val",
"H_vals",
"M",
"SMALL_VAL",
"LARGE_VAL",
"MicroaggWilberCalculator_edu",
"N_vals",
"N",
"setUp",
"tearDown",
]

# Good variable names regexes, separated by a comma. If names match any regex,
# they will always be accepted
good-names-rgxs = ["^[_a-zGW][_a-z0-9L]?$"]

[tool.pylint.format]
max-line-length = 225

[tool.pylint."messages control"]
disable = [
"missing-module-docstring",
"missing-class-docstring",
"missing-function-docstring",
"missing-final-newline",
"superfluous-parens",
]

[tool.pylint.main]
ignore = [".coveragerc"]
ignore-paths = [".coveragerc|.coveragerc"]
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
PyScaffold helps you to put up the scaffold of your new Python project.
Learn more under: https://pyscaffold.org/
"""

from setuptools import setup

if __name__ == "__main__":
Expand Down
Loading

0 comments on commit ccbc072

Please sign in to comment.