Skip to content

Commit

Permalink
feat: add lint to BE
Browse files Browse the repository at this point in the history
Adds flake8 as lint for python
Change github workflows to add flake
Closes #11
  • Loading branch information
rfgvieira committed Jun 25, 2024
1 parent 26257d0 commit a9a20e7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,7 @@ jobs:
- name: Run migrations
run: poetry run python manage.py migrate --no-input
working-directory: ./backend

- name: Lint
run: flake8
working-directory: ./backend
29 changes: 29 additions & 0 deletions backend/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[flake8]
exclude =
.git,
.venv,
.eggs,
__pycache__,
doc/source/conf.py,
build,
dist,
examples/github/github_schema.py,
examples/github/sample_operations.py,
examples/shopify/shopify_schema.py,
examples/shopify/shopify_operations.py

per-file-ignores =
examples/**:T201
utils/**:T201
# 'RST399 Document or section may not begin with a transition.', but none really :-(
sgqlc/introspection/__init__.py:RST399

# I801: from x import Y
# RST304: :class:, :func:, :mod: are supported by sphinx
# RST303: literalinclude is supported by sphinx
# N999: ignore dashes in the name (ideally only disabled for examples/)
# W503: old coding style (new PEP8 is enforced by W504)
ignore = I801,RST303,RST304,N999,W503
max-complexity = 10
max-line-length = 110
known-modules = websocket-client:[websocket],graphql-core:[graphql]
4 changes: 1 addition & 3 deletions backend/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env sh


#TODO: after setup python lint run command on pre-commit
# add tests if necessary
flake8

0 comments on commit a9a20e7

Please sign in to comment.