Skip to content

Commit

Permalink
add interrogate check
Browse files Browse the repository at this point in the history
  • Loading branch information
lalmei committed Nov 23, 2024
1 parent 18eb376 commit 667de5c
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 17 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ We will then review the changes and review next steps for adding the dataset int


### Installing uv

Install uv follow the guidelines in https://docs.astral.sh/uv/getting-started/installation/, it is recommended to use the standalone installation.
Dependencies and admin actions are done using `uv`. To Install uv follow the guidelines in https://docs.astral.sh/uv/getting-started/installation/, it is recommended to use the standalone installation.


### Building Project
Expand All @@ -206,15 +205,16 @@ To sync the dependencies simply run:
```
uv sync
```
### Running test

### Running tests

```
make test
```

### Running scripts

For running scripts or one using the project's e
For running scripts or one-offs using the project's installed enviroment

```
uv run python <script>
Expand Down
31 changes: 20 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dist.dir := dist
build.wheel := $(dist.dir)/agml-$(version).tar.gz



.PHONY: help
help: ## Print the help screen.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":|:[[:space:]].*?##"}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
Expand All @@ -25,24 +24,34 @@ test: $(test.python) $(src.python) ## Run tests
uv run pytest -c=config/pytest.ini $(test.python)


.PHONY: format
format: ## Run ruff format (Includes sorting of imports)
uv run ruff check --select I --config=config/ruff.toml --fix
uv run ruff format --config=config/ruff.toml $(src.python) $(test.python)
# Quality Checks

.PHONY: check-types
check-types: ## Run mypy to check type definitions.
uv run mypy --config=config/mypy.ini $(src.python) $(test.python)


.PHONY: check-format
check-format: ## Check ruff format
uv run ruff format --check --config=config/ruff.toml $(src.python) $(test.python)


.PHONY: lint
lint: ## Run ruff Code Linter
uv run ruff check --config=config/ruff.toml $(src.python) $(test.python)

.PHONY:docstring-coverage
docstring-coverage: ## Compute docstring coverage
uv run interrogate -c config/interrogate.toml .

# Quality fixes

.PHONY: lint-fix
lint-fix: ## Fix ruff Lint issues
uv run ruff check --fix --config=config/ruff.toml $(src.python) $(test.python)

.PHONY: lint
lint: ## Run ruff Code Linter
uv run ruff check --config=config/ruff.toml $(src.python) $(test.python)

.PHONY: check-types
check-types: ## Run mypy to check type definitions.
uv run mypy --config=config/mypy.ini $(src.python) $(test.python)
.PHONY: format
format: ## Run ruff format (Includes sorting of imports)
uv run ruff check --select I --config=config/ruff.toml --fix
uv run ruff format --config=config/ruff.toml $(src.python) $(test.python)
22 changes: 22 additions & 0 deletions config/interrogate.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[tool.interrogate]
ignore-init-method = true
ignore-init-module = true
ignore-magic = false
ignore-semiprivate = false
ignore-private = false
ignore-property-decorators = false
ignore-module = true
ignore-nested-functions = false
ignore-nested-classes = true
ignore-setters = false
fail-under = 40
exclude = ["setup.py", "docs", "build"]
ignore-regex = ["^get$", "^mock_.*", ".*BaseClass.*"]
# possible values: 0 (minimal output), 1 (-v), 2 (-vv)
verbose = 3
quiet = false
whitelist-regex = []
color = true
omit-covered-files = false
generate-badge = "interrogate_badge.svg"
badge-format = "svg"
1 change: 1 addition & 0 deletions config/ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ docstring-code-format = false
docstring-code-line-length = "dynamic"

[lint.isort]

case-sensitive = true
default-section = "third-party"
known-first-party = ["agml"]
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ classifiers = [
"Typing :: Typed",
]



# managed by uv
dependencies = [
"matplotlib>=3.7.5",
Expand Down

0 comments on commit 667de5c

Please sign in to comment.