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

docs: filling out a bit more #79

Merged
merged 1 commit into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 12 additions & 5 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ detailed description of best practices for developing Scikit-HEP packages.

[scientific-python development pages]: https://learn.scientific-python.org/development

# Quick development
## Quick development

The fastest way to start with development is to use nox. If you don't have nox,
you can use `pipx run nox` to run it without installing, or `pipx install nox`.
Expand All @@ -26,7 +26,9 @@ $ nox -s build # Make an SDist and wheel
Nox handles everything for you, including setting up an temporary virtual
environment for each run.

# Setting up a development environment manually
You can also use `nox -s run -- .` to run an example set of checks on a repo.

## Setting up a development environment manually

You can set up a development environment by running:

Expand Down Expand Up @@ -56,15 +58,15 @@ pre-commit install # Will install a pre-commit hook into the git repo

You can also/alternatively run `pre-commit run` (changes only) or `pre-commit run --all-files` to check even without installing the hook.

# Testing
## Testing

Use pytest to run the unit checks:

```bash
pytest
```

# Building docs
## Building docs

You can build the docs using:

Expand All @@ -78,7 +80,7 @@ You can see a preview with:
nox -s docs -- serve
```

# Pre-commit
## Pre-commit

This project uses pre-commit for all style checking. While you can run it with
nox, this is such an important tool that it deserves to be installed on its
Expand All @@ -89,3 +91,8 @@ pre-commit run -a
```

to check all files.

## Running DevContainer

You can use DevContainer, such as in GitHub Codespaces or locally. Nox and a
local install will be available.
6 changes: 3 additions & 3 deletions docs/checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ Here is the suggested function for the above example:

```python
def repo_review_checks() -> dict[str, General | PyProject]:
return {p.__name__: p() for p in General.__subclasses__()} | {
p.__name__: p() for p in PyProject.__subclasses__()
}
general = {p.__name__: p() for p in General.__subclasses__()}
pyproject = {p.__name__: p() for p in PyProject.__subclasses__()}
return general | pyproject
```

You tell repo review to use this function via an entry-point:
Expand Down
33 changes: 33 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# CLI

Repo-review has a CLI interface.

```{program-output} python -m repo_review --help

```

There are three output formats; `rich` produces great terminal output, `html`
produces an HTML report, and `json` produces a output that can be processed
easily.

JSON output looks like this:

```json
{
"families": {
"pyproject": {},
"general": {}
},
"checks": {
"PY001": {
"family": "general",
"description": "Has a pyproject.toml",
"result": true,
"err_msg": "",
"url": ""
},
"PY002": {
"family": "general",
"description": "Has a README.(md|rst) file",
"result": true,
"err_msg": "",
"url": ""
}
}
}
```
6 changes: 6 additions & 0 deletions docs/families.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ families = "my_plugin_package.my_family_module:get_families"
```

The entry-point name doesn't matter.

```{admonition} Fixtures
Unlike almost all other parts of the API, the family function does not support
fixtures. This could be added if there is a need, but usually not needed - if a
check is not present from a family, the family will not be displayed.
```