-
Notifications
You must be signed in to change notification settings - Fork 0
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 #9 from smart-on-fhir/mikix/cleanup
Switch to ruff and update the README with more API examples
- Loading branch information
Showing
6 changed files
with
145 additions
and
47 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
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,7 +1,10 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
#this version is synced with the black mentioned in .github/workflows/ci.yml | ||
rev: 24.4.2 | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.8.3 # keep in rough sync with pyproject.toml | ||
hooks: | ||
- id: black | ||
entry: bash -c 'black "$@"; git add -u' -- | ||
- name: Ruff formatting | ||
id: ruff-format | ||
entry: bash -c 'ruff format --force-exclude "$@"; git add -u' -- | ||
- name: Ruff linting | ||
id: ruff | ||
stages: [pre-push] |
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
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
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
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ dependencies = [ | |
authors = [ | ||
{ name="Michael Terry", email="[email protected]" }, | ||
] | ||
description = "FHIR schema support code for the Cumulus project" | ||
description = "FHIR support code for the Cumulus project" | ||
readme = "README.md" | ||
license = { text="Apache License 2.0" } | ||
classifiers = [ | ||
|
@@ -33,19 +33,35 @@ include = [ | |
"*.md", | ||
] | ||
|
||
[tool.bandit] | ||
exclude_dirs = ["tests"] | ||
|
||
[tool.black] | ||
line-length = 100 | ||
|
||
[project.optional-dependencies] | ||
tests = [ | ||
"ddt", | ||
"pytest", | ||
"pytest-cov", | ||
] | ||
dev = [ | ||
"black >= 24, < 25", | ||
"pre-commit", | ||
] | ||
# Ruff is using minor versions for breaking changes until their 1.0 release. | ||
# See https://docs.astral.sh/ruff/versioning/ | ||
"ruff < 0.9", # keep in rough sync with pre-commit-config.yaml | ||
] | ||
|
||
[tool.ruff] | ||
line-length = 100 | ||
|
||
[tool.ruff.lint] | ||
allowed-confusables = ["’"] # allow proper apostrophes | ||
select = [ | ||
"A", # prevent using keywords that clobber python builtins | ||
"E", # pycodestyle | ||
"F", # pyflakes | ||
"I", # isort | ||
"PLE", # pylint errors | ||
"PLW", # pylint warnings | ||
"RUF", # the ruff developer's own rules | ||
"S", # bandit security warnings | ||
"UP", # alert you when better syntax is available in your python version | ||
] | ||
|
||
[tool.ruff.lint.per-file-ignores] | ||
"**/__init__.py" = ["F401"] # init files hold API, so not using imports is intentional |