Skip to content

Commit

Permalink
remove use of flake8, isort, & pylint (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
ITProKyle authored Apr 16, 2024
1 parent e0528a5 commit c422446
Show file tree
Hide file tree
Showing 8 changed files with 736 additions and 2,767 deletions.
38 changes: 0 additions & 38 deletions .flake8

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*$py.class
**/.secrets
*.cover
*.egg
*.egg-info/
Expand Down
11 changes: 10 additions & 1 deletion .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@
}
],
"ignorePaths": [
"**/*.egg-info/**",
"**/*.css",
"**/*.egg-info/**",
"**/*.js",
"**/*.pyc",
"**/*.ts",
"**/.git",
"**/.github/labels.yml",
"**/.gitignore",
"**/.venv/**",
"**/.vscode/extensions.json",
"**/.vscode/settings.json",
"**/Pipfile.lock",
"**/__pycache__/**",
"**/build/**",
Expand Down Expand Up @@ -46,6 +51,7 @@
"words": [
"autofix",
"boto",
"botocore",
"direnv",
"docstrings",
"favicon",
Expand All @@ -57,6 +63,7 @@
"kwarg",
"labelmaker",
"maint",
"markdownlint",
"mdformat",
"noqa",
"overlining",
Expand All @@ -70,8 +77,10 @@
"subclassing",
"ungrouped",
"venv",
"venvpath",
"virtualenvs",
"winget",
"wontfix",
"xargs",
"yamlfmt"
]
Expand Down
59 changes: 20 additions & 39 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,84 +1,65 @@
.PHONY: docs

CI := $(if $(CI),yes,no)
SHELL := /bin/bash

help: ## show this message
@IFS=$$'\n' ; \
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/:/'`); \
printf "%-30s %s\n" "target" "help" ; \
printf "%-30s %s\n" "------" "----" ; \
for help_line in $${help_lines[@]}; do \
IFS=$$':' ; \
help_split=($$help_line) ; \
help_command=`echo $${help_split[0]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
help_info=`echo $${help_split[2]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
printf '\033[36m'; \
printf "%-30s %s" $$help_command ; \
printf '\033[0m'; \
printf "%s\n" $$help_info; \
done
ifeq ($(CI), yes)
POETRY_OPTS = "-v"
PRE_COMMIT_OPTS = --show-diff-on-failure --verbose
endif

.PHONY: docs
docs: ## delete current HTML docs & build fresh HTML docs
@make -C docs docs
@$(MAKE) --no-print-directory -C docs docs

docs-changes: ## build HTML docs; only builds changes detected by Sphinx
@make -C docs html
@$(MAKE) --no-print-directory -C docs html

fix-black: ## automatically fix all black errors
@poetry run black .

fix-isort: ## automatically fix all isort errors
@poetry run isort .

fix-md: ## automatically fix markdown format errors
@poetry run pre-commit run mdformat --all-files

lint: lint-black lint-isort lint-pyright lint-flake8 ## run linters
lint: lint-black lint-pyright ## run linters

lint-black: ## run black
@echo "Running black... If this fails, run 'make fix-black' to resolve."
@poetry run black . --check --color --diff
@echo ""

lint-flake8: ## run flake8
@echo "Running flake8..."
@poetry run flake8
@echo ""

lint-isort: ## run isort
@echo "Running isort... If this fails, run 'make fix-isort' to resolve."
@poetry run isort . --check-only
@echo ""

lint-pyright: ## run pyright
@echo "Running pyright..."
@npx pyright --venv-path ./
@npm exec --no -- pyright --venvpath ./
@echo ""

open-docs: ## open docs (HTML files must already exists)
@make -C docs open
@$(MAKE) --no-print-directory -C docs open

run-pre-commit: ## run pre-commit for all files
@poetry run pre-commit run -a
@poetry run pre-commit run $(PRE_COMMIT_OPTS) \
--all-files \
--color always

setup: setup-poetry setup-pre-commit setup-npm ## setup dev environment

setup-npm: ## install node dependencies with npm
@npm ci

setup-poetry: ## setup python virtual environment
@poetry install \
@poetry check
@poetry install $(POETRY_OPTS) \
--extras docs \
--remove-untracked
--sync

setup-pre-commit: ## install pre-commit git hooks
@poetry run pre-commit install

spellcheck: ## run cspell
@echo "Running cSpell to checking spelling..."
@npx cspell "**/*" \
@npm exec --no -- cspell lint . \
--color \
--config .vscode/cspell.json \
--dot \
--gitignore \
--must-find-files \
--no-progress \
--relative \
Expand Down
Loading

0 comments on commit c422446

Please sign in to comment.