Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a style check env #564

Closed
wants to merge 8 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Source = "https://github.com/amazon-braket/amazon-braket-examples"

[tool.hatch.envs.default]
dependencies = [
"black[jupyter]",
"jupyter",
"nbconvert",
"pytest",
Expand All @@ -56,9 +57,31 @@ python -m ipykernel install --user --name "conda_braket" --display-name "conda_b
pytest --dist worksteal -n logical -ra -v --durations=0 test/
"""

[tool.hatch.envs.lint]
detached = true
dependencies = [
"black[jupyter]>=23.1.0",
]

[tool.hatch.envs.lint.scripts]
style = [
"black --check --diff {args:.}",
]
fmt = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you run the style check on the repo and it didn't recommend any changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had ran this and there were suggestions which can be fixed with hatch run lint:fmt . However, for introducing this, I was adding this in a shadow run mode for the time being without the changes.

"black {args:.}",
"style",
]

[[tool.hatch.envs.all.matrix]]
python = ["3.9", "3.10", "3.11"]


[tool.black]
target-version = ["py39"]
line-length = 100
skip-string-normalization = true
multi_line_output = 3
include_trailing_comma = true

[tool.hatch.metadata]
allow-direct-references = true