-
Notifications
You must be signed in to change notification settings - Fork 55
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 #12 from Never-Over/update-docs-show
cli/doc improvements
- Loading branch information
Showing
9 changed files
with
136 additions
and
122 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,4 +44,4 @@ jobs: | |
- name: Check modguard | ||
run: | | ||
pip install . | ||
modguard --exclude tests . | ||
modguard check --exclude tests . |
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 |
---|---|---|
@@ -1,39 +1,59 @@ | ||
# Usage | ||
|
||
## modguard | ||
Modguard will flag any unwanted imports between modules. It is recommended to run `modguard` in a similar way as a linter or test runner, e.g. in pre-commit hooks, on-save hooks, and in CI pipelines. | ||
## modguard check | ||
Modguard will flag any unwanted imports between modules. It is recommended to run `modguard check` in a similar way as a linter or test runner, e.g. in pre-commit hooks, on-save hooks, and in CI pipelines. | ||
|
||
``` | ||
usage: modguard [-h] [-e file_or_path,...] path | ||
```bash | ||
usage: modguard check [-h] [-e file_or_path,...] path | ||
|
||
Check boundaries with modguard | ||
|
||
positional arguments: | ||
path The path of the root of your project that contains all defined boundaries. | ||
path The path of the root of your Python project. | ||
|
||
options: | ||
-h, --help show this help message and exit | ||
-e file_or_path,..., --exclude file_or_path,... | ||
Comma separated path list to exclude. tests/,ci/,etc. | ||
Make sure modguard is run from the root of your repo that a directory is being specified. For example: `modguard .` | ||
Comma separated path list to exclude. tests/, ci/, etc. | ||
``` | ||
|
||
|
||
## modguard init | ||
Modguard comes bundled with a command to set up and define your initial boundaries. | ||
|
||
By running `modguard init` from the root of your python project, modguard will declare boundaries on each python package within your project. Additionally, each member of that package which is imported from outside the boundary will be marked `public`. | ||
By running `modguard init .` from the root of your python project, modguard will declare boundaries on each python package within your project. Additionally, each member of that package which is imported from outside the boundary will be marked `public`. | ||
|
||
This will automatically lock-in the public interface for each package within your project, and instantly reach a passing state when running `modguard` | ||
``` | ||
```bash | ||
usage: modguard init [-h] [-e file_or_path,...] path | ||
|
||
Initialize boundaries in a repository with modguard | ||
Initialize boundaries with modguard | ||
|
||
positional arguments: | ||
path The path of the Python project in which boundaries should be initialized. | ||
path The path of the root of your Python project. | ||
|
||
options: | ||
-h, --help show this help message and exit | ||
-e file_or_path,..., --exclude file_or_path,... | ||
Comma separated path list to exclude. tests/,ci/,etc. | ||
Comma separated path list to exclude. tests/, ci/, etc. | ||
``` | ||
|
||
|
||
## modguard show | ||
Modguard can display your current set of boundaries and public interfaces. | ||
|
||
By running `modguard show .` from the root of your python project, you can view your full project's file tree annotated with both boundaries (`[B]`) and members that have been defined as public (`[P]`). Optionally, specifying `-w/--write` will write the output to a `modguard.yaml` file, which can then be consumed for external usecases. | ||
```bash | ||
usage: modguard show [-h] [-e file_or_path,...] [-w] path | ||
|
||
Show your existing boundaries in modguard | ||
|
||
positional arguments: | ||
path The path of the root of your Python project. | ||
|
||
options: | ||
-h, --help show this help message and exit | ||
-e file_or_path,..., --exclude file_or_path,... | ||
Comma separated path list to exclude. tests/, ci/, etc. | ||
-w, --write Write the output to a `modguard.yaml` file | ||
``` |
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
Oops, something went wrong.