Skip to content

chore: add AGENTS.md and switch pre-commit to ruff-only#293

Merged
thodson-usgs merged 3 commits into
DOI-USGS:mainfrom
thodson-usgs:chore/pre-commit-ruff-and-agents-md
May 28, 2026
Merged

chore: add AGENTS.md and switch pre-commit to ruff-only#293
thodson-usgs merged 3 commits into
DOI-USGS:mainfrom
thodson-usgs:chore/pre-commit-ruff-and-agents-md

Conversation

@thodson-usgs
Copy link
Copy Markdown
Collaborator

Summary

Three independent commits in one PR; reviewable separately.

  • chore(lint): replace flake8/prettier configs with ruff-only pre-commit. CI already lints with ruff only (.github/workflows/python-package.yml), so .flake8 and .prettierrc.toml were dead config. Rewrote .pre-commit-config.yaml to drop the legacy formatter/linter zoo (black, blackdoc, flake8, isort, prettier, pyupgrade, double-quote-string-fixer) and added astral-sh/ruff-pre-commit so local pre-commit matches CI. Excluded tests/data/ from trailing-whitespace/end-of-file-fixer/mixed-line-ending because those fixtures are byte-exact API response captures (RDB/TSV with significant trailing tabs) and must not be normalized.
  • docs: add AGENTS.md. Repo guide for AI/automation agents: scope and excluded paths, example notebook index (demos/*.ipynb, demos/hydroshare/*.ipynb, plus the non-notebook demos/nwqn_data_pull/ lithops example), environment/lint/test/docs commands, testing gotchas (pytest-httpx fixture, Python <3.10 skips), and waterdata implementation notes (httpx client, kwarg-to-API spelling translation, OGC byte-limit auto-chunking).
  • chore: fix trailing whitespace and missing EOF newlines. Auto-fixes from the new hooks across docs (.rst, .nblink), README code snippets, .gitignore, the nwqn Dockerfile, and the py.typed marker. No behavior changes — clearing the slate so the next commit anyone makes doesn't trip the hook.

Test plan

  • ruff check . and ruff format --check . pass on the tracked tree.
  • pre-commit run --all-files is clean after the three commits.
  • Each commit was made through the installed pre-commit hook.
  • CI lint job passes (no behavior expected to change — it already runs ruff check + ruff format --check).

🤖 Generated with Claude Code

thodson-usgs and others added 3 commits May 28, 2026 11:50
CI already lints with ruff exclusively (python-package.yml), so .flake8
and .prettierrc.toml were dead config. Rewrite .pre-commit-config.yaml
to drop black, blackdoc, flake8, isort, prettier, pyupgrade, and
double-quote-string-fixer (all superseded by ruff check + ruff format)
and add astral-sh/ruff-pre-commit so local pre-commit matches CI.

Exclude tests/data/ from trailing-whitespace, end-of-file-fixer, and
mixed-line-ending; those fixtures are byte-exact API response captures
(RDB/TSV with significant trailing tabs) and must not be normalized.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Brief guide for agents working in this repo: scope and excluded paths,
example notebook index (demos/*.ipynb plus demos/hydroshare/*.ipynb),
environment/lint/test/docs commands, testing gotchas (pytest-httpx
fixture, Python <3.10 skips), and waterdata implementation notes
(httpx client, kwarg-to-API spelling translation, OGC byte-limit
auto-chunking in dataretrieval/waterdata/chunking.py).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Auto-fixes from the new pre-commit hooks (trailing-whitespace,
end-of-file-fixer). Touched files are docs (.rst, .nblink), the README
code snippets, .gitignore, the nwqn Dockerfile, and the py.typed
marker. No behavior changes; this clears the slate so future commits
don't trip the hook on day one.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@thodson-usgs thodson-usgs marked this pull request as ready for review May 28, 2026 18:02
@thodson-usgs thodson-usgs merged commit 906c859 into DOI-USGS:main May 28, 2026
8 checks passed
@thodson-usgs thodson-usgs deleted the chore/pre-commit-ruff-and-agents-md branch May 28, 2026 18:04
thodson-usgs added a commit to thodson-usgs/dataretrieval-python that referenced this pull request May 28, 2026
Stacks on DOI-USGS#293 (which switched pre-commit to ruff-only and cleaned the
text-file housekeeping). The one piece DOI-USGS#293 didn't cover is the
checked-in notebook outputs — they balloon the demo notebook diffs on
every re-run with timestamps, quota counters, and HTML/plot blobs, even
when the source cells are unchanged.

Adds the kynan/nbstripout pre-commit hook (rev 0.8.1) and runs it once
across the existing tree, stripping cell outputs + execution_count from
the 15 checked-in waterdata notebooks. Demos still execute cleanly
locally; commits now diff the source rather than the rendered run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
thodson-usgs added a commit that referenced this pull request May 28, 2026
Stacks on #293 (which switched pre-commit to ruff-only and cleaned the
text-file housekeeping). The one piece #293 didn't cover is the
checked-in notebook outputs — they balloon the demo notebook diffs on
every re-run with timestamps, quota counters, and HTML/plot blobs, even
when the source cells are unchanged.

Adds the kynan/nbstripout pre-commit hook (rev 0.8.1) and runs it once
across the existing tree, stripping cell outputs + execution_count from
the 15 checked-in waterdata notebooks. Demos still execute cleanly
locally; commits now diff the source rather than the rendered run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant