Skip to content
Draft
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
10 changes: 9 additions & 1 deletion .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,12 @@ jobs:
- name: Verify generated ownership files
run: poetry run python scripts/sync_ownership.py --check

- uses: pre-commit/action@v3.0.1
- name: Show quality tool versions
run: |
poetry run black --version
poetry run isort --version-number
poetry run yamlfix --version
poetry run pre-commit --version

- name: Run pre-commit checks
run: poetry run pre-commit run --all-files --show-diff-on-failure
12 changes: 10 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Once you have the repository on your system you can proceed:
1. `poetry install` - Installs required packages setup in [pyproject.toml](/pyproject.toml)
1. To validate poetry/`pyproject.toml` you can run: `poetry check`
2. `poetry run pre-commit install` - Sets up black and other configurations using [.pre-commit-config.yaml](/.pre-commit-config.yaml) in `.git/hooks`
1. You can test all files with `poetry run pre-commit run --all-files`
1. You can test all files with `poetry run pre-commit run --all-files --show-diff-on-failure`
3. `python -m pip install -e .` - This adds cwms-cli and it's commands to your local path allowing you to live develop cwms-cli as a package and test the CLI functions on your system.
4. Run `cwms-cli` to confirm everything installed!

Expand Down Expand Up @@ -82,7 +82,15 @@ Contributor expectation for `csv2cwms`:

## Formatting

Formatting of code is done via black. You must ensure you have walked through the getting start to setup the `pre-commit` steps for black to match this repositories style practices.
Formatting of code is done via black through the configured `pre-commit` hooks. Run `poetry install --with dev --no-interaction` before quality checks so local tools use the versions locked for this repository.

Before pushing, run:

```shell
poetry run pre-commit run --all-files --show-diff-on-failure
```

This command may rewrite files if formatting has drifted. Run it from a clean branch or review `git status --short` afterward so you only commit intentional changes.

## Code Review

Expand Down
12 changes: 8 additions & 4 deletions cwmscli/commands/commands_cwms.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,15 @@ def update_cli_cmd(target_version: Optional[str], pre: bool, yes: bool) -> None:
@click.group(
"blob",
help="Manage CWMS Blobs (upload, download, delete, update, list)",
epilog=textwrap.dedent("""
epilog=textwrap.dedent(
"""
Example Usage:\n
- Store a PDF/image as a CWMS blob with optional description\n
- Download a blob by id to your local filesystem\n
- Update a blob's name/description/mime-type\n
- Bulk list blobs for an office
"""),
"""
),
)
def blob_group():
pass
Expand Down Expand Up @@ -706,12 +708,14 @@ def list_cmd(**kwargs):
@click.group(
"clob",
help="Manage CWMS Clobs (upload, download, delete, update, list)",
epilog=textwrap.dedent("""
epilog=textwrap.dedent(
"""
Example Usage:\n
- Download a clob by id to your local filesystem\n
- Update a clob's name/description/mime-type\n
- Bulk list clobs for an office
"""),
"""
),
)
@requires(reqs.cwms)
def clob_group():
Expand Down
116 changes: 3 additions & 113 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ cwms-python = { version = ">=1.0.7", optional = true}
colorama = "^0.4.6"

[tool.poetry.group.dev.dependencies]
black = [
{ version = "^26.3.1", python = ">=3.10" },
{ version = "^24.2.0", python = ">=3.9,<3.10" },
]
black = "==24.10.0"
isort = "^5.13.2"
mypy = "^1.9.0"
pre-commit = "^3.6.2"
Expand Down
Loading