-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from Matatika/ruff-lint-format
Setup Ruff linting/formatting
- Loading branch information
Showing
24 changed files
with
277 additions
and
544 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,39 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
ci: | ||
autofix_prs: true | ||
autoupdate_schedule: weekly | ||
autoupdate_commit_msg: 'chore: pre-commit autoupdate' | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- repo: local | ||
hooks: | ||
- id: lint | ||
name: Lint | ||
language: system | ||
entry: make lint | ||
pass_filenames: false | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-json | ||
exclude: | | ||
(?x)^( | ||
\.vscode/.*\.json | ||
)$ | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/python-jsonschema/check-jsonschema | ||
rev: 0.27.3 | ||
hooks: | ||
- id: check-dependabot | ||
- id: check-github-workflows | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.14 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix, --show-fixes] | ||
- id: ruff-format | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.8.0 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: | ||
- types-requests | ||
exclude: tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,15 @@ | ||
.PHONY: help init lint lint-fix test | ||
.PHONY: help init lint test | ||
|
||
help: | ||
@echo AVAILABLE COMMANDS | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-23s\033[0m%s\n", $$1, $$2}' | ||
|
||
init: ## Initialise repo for local development | ||
@poetry install -v | ||
@! test -d ~/.cache/pre-commit || poetry run pre-commit clean | ||
@poetry run pre-commit install -f --install-hooks | ||
@poetry install --sync --with dev | ||
@poetry run pre-commit install --install-hooks | ||
|
||
lint: ## Lint source files | ||
poetry run autoflake --check --recursive --exclude tests --remove-all-unused-imports --remove-duplicate-keys --remove-unused-variables --verbose tap_spotify | ||
poetry run isort --check --diff tap_spotify | ||
poetry run black --check --diff tap_spotify | ||
poetry run flake8 --max-complexity 10 tap_spotify | ||
|
||
lint-fix: ## Lint source files and fix any issues | ||
poetry run autoflake --in-place --recursive --exclude tests --remove-all-unused-imports --remove-duplicate-keys --remove-unused-variables --verbose tap_spotify | ||
poetry run isort tap_spotify | ||
poetry run black tap_spotify | ||
lint: ## Lint files | ||
poetry run pre-commit run ruff | ||
|
||
test: ## Run tests | ||
@poetry run pytest |
Oops, something went wrong.