Skip to content

Commit

Permalink
#165: Add skeleton linting functionality
Browse files Browse the repository at this point in the history
- As per Hypermodern Python guide
  • Loading branch information
MRichards99 committed Oct 28, 2020
1 parent 66d0ab1 commit fb3f320
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# .flake8
[flake8]
select = B,B9BLK,C,E,F,I,S,W
ignore = E203,W503,E501
max-complexity = 10
max-line-length = 80
application-import-names = common,src,test,util
import-order-style = google
per-file-ignores = test/*:S101
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ venv/
logs.log
config.json
.vscode/
.nox/
4 changes: 3 additions & 1 deletion dev-requirements.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pip-tools == 5.3.1
Faker == 2.0.2
black == 19.10b0
black == 19.10b0
nox==2020.8.22
flake8==3.8.4
18 changes: 16 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,33 @@
#
# pip-compile dev-requirements.in
#
appdirs==1.4.4 # via black
appdirs==1.4.4 # via black, virtualenv
argcomplete==1.12.1 # via nox
attrs==19.3.0 # via black
black==19.10b0 # via -r dev-requirements.in
click==7.1.2 # via black, pip-tools
colorlog==4.4.0 # via nox
distlib==0.3.1 # via virtualenv
faker==2.0.2 # via -r dev-requirements.in
filelock==3.0.12 # via virtualenv
flake8==3.8.4 # via -r dev-requirements.in
importlib-metadata==2.0.0 # via argcomplete, flake8, nox, virtualenv
importlib-resources==3.2.1 # via virtualenv
mccabe==0.6.1 # via flake8
nox==2020.8.22 # via -r dev-requirements.in
pathspec==0.8.0 # via black
pip-tools==5.3.1 # via -r dev-requirements.in
py==1.9.0 # via nox
pycodestyle==2.6.0 # via flake8
pyflakes==2.2.0 # via flake8
python-dateutil==2.8.0 # via faker
regex==2020.7.14 # via black
six==1.12.0 # via faker, pip-tools, python-dateutil
six==1.12.0 # via faker, pip-tools, python-dateutil, virtualenv
text-unidecode==1.3 # via faker
toml==0.10.1 # via black
typed-ast==1.4.1 # via black
virtualenv==20.1.0 # via nox
zipp==3.4.0 # via importlib-metadata, importlib-resources

# The following packages are considered to be unsafe in a requirements file:
# pip
29 changes: 29 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import nox

# Separating Black away from the rest of the sessions
nox.options.sessions = "lint"
code_locations = "common", "src", "test", "util", "noxfile.py"


@nox.session(python="3.6")
def format(session):
args = session.posargs or code_locations
session.run("black", *args, external=True)


@nox.session(python="3.6")
def lint(session):
args = session.posargs or code_locations
session.install(
"flake8",
"flake8-bandit",
"flake8-black",
"flake8-bugbear",
"flake8-import-order",
)
session.run("flake8", *args)

@nox.session(python="3.6")
def safety(session):
session.install("safety")
session.run("safety", "check", "-r", "requirements.txt", "--full-report")

0 comments on commit fb3f320

Please sign in to comment.