Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package Management + Coding Style #45

Open
aqeelat opened this issue Sep 23, 2022 · 1 comment
Open

Package Management + Coding Style #45

aqeelat opened this issue Sep 23, 2022 · 1 comment
Assignees

Comments

@aqeelat
Copy link
Contributor

aqeelat commented Sep 23, 2022

What do you think about using poetry in the project?

Also, what do you think about using a pre-commit to enforce a coding style such as Black?

@bashu
Copy link
Owner

bashu commented Oct 2, 2022

let's start with pre-commit (black, flack8, isort and pyupgrade too), here what I have in my private projects:

exclude: "^docs/|/migrations/"
default_stages: [commit]

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.3.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml

  - repo: https://github.com/asottile/pyupgrade
    rev: v2.32.0
    hooks:
      - id: pyupgrade
        args: ["--py3-plus"]

  - repo: https://github.com/psf/black
    rev: 22.6.0
    hooks:
      - id: black

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

  - repo: https://github.com/PyCQA/flake8
    rev: 5.0.4
    hooks:
      - id: flake8
        args: ["--config=setup.cfg"]
        additional_dependencies: [flake8-isort]

# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date
ci:
  autoupdate_schedule: weekly
  skip: []
  submodules: false

and setup.cfg:

[flake8]
max-line-length = 120
exclude = .tox,.git,*/migrations/*,docs

[isort]
# This is the config for the isort import sorting tool.
# https://github.com/timothycrosley/isort/
# isort also informs flake8 linting via the flake8-isort library.
skip_glob = **/migrations/*.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants