diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-10-27 15:08:58 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-10-27 18:25:58 -0700 |
commit | 02249d03d086e71a589733280a2f5e32990f72b1 (patch) | |
tree | f3e4da860d40a938ec2a8f3d0af101e5bdb9e08b | |
parent | 40cc2abe0c7b52d84ca016520b2e96b25bae76b2 (diff) | |
download | fatcat-scholar-02249d03d086e71a589733280a2f5e32990f72b1.tar.gz fatcat-scholar-02249d03d086e71a589733280a2f5e32990f72b1.zip |
update lint, fmt, make settings
-rw-r--r-- | .flake8 | 15 | ||||
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | pyproject.toml | 3 |
3 files changed, 22 insertions, 5 deletions
@@ -1,6 +1,15 @@ [flake8] select = C,E,F,W,ANN -ignore = F405,F403,W503,E231,E203,E501,E226,E711,E713,E265,ANN101,ANN204,ANN102 -max-complexity = 25 +# ANN003 is annotation on, eg, **kwargs +# ANN101 is annotation on 'self' +# ANN204 is annotation on '__init__()' +# E265,E266 are restrictions on comments ('#') +# E501 is line-too-long, which we enforce with black +# W503,E203 are allowed by black +ignore = ANN003,ANN101,ANN204,E265,E266,E501,W503,E203 +per-file-ignores = + fatcat_scholar/__init__.py: F401 + tests/*.py: ANN201,ANN001,F403,F405 exclude = .git,__pycache__,.venv -max-line-length = 120 +max-line-length = 88 +max-complexity = 30 @@ -16,12 +16,17 @@ dep: ## Install dependencies using pipenv .PHONY: lint lint: ## Run lints (eg, flake8, mypy) pipenv run flake8 fatcat_scholar/ tests/ --exit-zero + pipenv run isort -q -c fatcat_scholar/ tests/ || true pipenv run mypy fatcat_scholar/ tests/ --ignore-missing-imports - #pipenv run pytype fatcat_scholar/ + +.PHONY: pytype +pytype: ## Run slow pytype type check (not part of dev deps) + pipenv run pytype fatcat_scholar/ .PHONY: fmt fmt: ## Run code formating on all source code - pipenv run black fatcat_scholar/ tests/ + pipenv run isort --atomic fatcat_scholar/ tests/ + pipenv run black --line-length 88 fatcat_scholar/ tests/ .PHONY: test test: ## Run all tests and lints diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e1d02b6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[tool.isort] +profile = "black" +line_length = 88 |