diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..1092bd1 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,66 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace # Trailing whitespace checker + - id: end-of-file-fixer # End-of-file newline checker + - id: check-yaml # YAML syntax checker + - id: check-added-large-files # Prevents you from committing large files + - id: check-ast # Python AST checker + - id: check-json # JSON syntax checker + - id: check-xml # XML syntax checker + + - repo: https://github.com/psf/black + rev: 23.12.1 + hooks: + - id: black + - repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + args: ["--profile", "black"] + - repo: https://github.com/pycqa/flake8 + rev: 6.1.0 + hooks: + - id: flake8 + additional_dependencies: + # source: https://github.com/DmytroLitvinov/awesome-flake8-extensions + # all-in-one plugins + - flake8-bugbear # tries to find bugs in your code + - flake8-simplify # encourages simplification of complex expressions + + # clean code + - flake8-comprehensions # helps you write better list/set/dict comprehensions + - flake8-picky-parentheses # checks for redundant parentheses and alignment of parentheses and brackets + - flake8-return # plugin that checks return values + + # naming + - flake8-builtins # checks for python builtins being used as variables or parameters + - flake8-variables-names # checks for good variable names + - pep8-naming # enforces PEP 8 naming conventions + + # complexity + - flake8-cognitive-complexity # plugin that checks for high cognitive complexity + - flake8-annotations-complexity # enforces complexity limits for function annotations + + # docstrings + - flake8-spellcheck # checks spelling + - flake8-docstrings # docstring conventions + + # imports + - flake8-import-order # enforces a lexicographic ordering of import statements + + # Comments + - flake8-eradicate # enforces the removal of commented out code + + # Annotations + - flake8-black # enforces black formatting + args: + [ + "--max-line-length", + "88", + "--extend-ignore", + "D100, SC200", + "--max-cognitive-complexity", + "3", + ] diff --git a/main.py b/main.py index e69de29..c7d1488 100644 --- a/main.py +++ b/main.py @@ -0,0 +1,6 @@ +import numpy as np + +if __name__ == "__main__": + numbers = list(range(1, 11)) + numbers_array = np.array(numbers) + print(numbers_array) diff --git a/requirements.txt b/requirements.txt index e69de29..723ca13 100644 --- a/requirements.txt +++ b/requirements.txt @@ -0,0 +1 @@ +numpy == 1.26.1