Skip to content

Commit

Permalink
Finish tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
antonymilne committed Oct 30, 2023
1 parent 0edebb3 commit 1566ddf
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ jobs:
hatch version patch,dev
hatch run changelog:add
hatch run schema
hatch run lint || hatch run lint
git config user.email "[email protected]"
git config user.name "Vizro Team"
git add -A
Expand Down
2 changes: 1 addition & 1 deletion vizro-core/docs/pages/development/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ line-length = 120
Linting checks are enforced in CI. To run pre-commit hooks locally, there are two options:

1. Run `hatch run pre-commit install` to automatically run the hooks on every commit (you can always skip the checks with `git commit --no-verify`). In case this fails due to `gitleaks`, please read below for an explanation and how to install `go`.
2. Run `hatch run lint` to run `pre-commit` hooks on all files. (You can run eg `hatch run lint mypy` to only run specific linters, here mypy.)
2. Run `hatch run lint` to run `pre-commit` hooks on all files. (You can run e.g. `hatch run lint mypy -a` to only run specific linters, here mypy, on all files.)

Note that Hatch's `default` environment specifies `pre-commit` as a dependency but otherwise _does not_ specify dependencies for linting tools such as `black`. These are controlled by [.pre-commit-config.yaml](https://github.com/mckinsey/vizro/blob/main/.pre-commit-config.yaml) and can be updated when required with `pre-commit autoupdate`.

Expand Down
7 changes: 2 additions & 5 deletions vizro-core/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,18 @@ cov-report = [
"coverage report"
]
example = "cd examples/{args:default}; python app.py"
lint = "SKIP=gitleaks pre-commit run {args}"
# change checks to do --all-files
# remove hatch run lint everywhere it's not needed
lint = "SKIP=gitleaks pre-commit run {args:--all-files}"
prep-release = [
"hatch version release",
"hatch run changelog:scriv collect --add",
"rm -rf schemas/*json",
"schema",
"git add schemas",
"hatch run lint || hatch run lint",
"hatch run changelog:add",
'echo "Now raise a PR to merge into main with title: Release of vizro-core $(hatch version)"'
]
pypath = "python -c 'import sys; print(sys.executable)'"
schema = ["python schemas/generate.py {args}", "lint --files=schemas/$(hatch version).json > /dev/null"]
schema = ["python schemas/generate.py {args}", "hatch run lint --files=schemas/$(hatch version).json > /dev/null"]
secrets = "pre-commit run gitleaks --all-files"
test = [
"test-unit",
Expand Down
1 change: 0 additions & 1 deletion vizro-core/schemas/generate.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Script to generate JSON schema. For more information, run `hatch run schema --help`."""
import argparse
import json
import subprocess
import sys
from pathlib import Path

Expand Down

0 comments on commit 1566ddf

Please sign in to comment.