chore: add AGENTS.md and switch pre-commit to ruff-only#293
Merged
thodson-usgs merged 3 commits intoMay 28, 2026
Merged
Conversation
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
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>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three independent commits in one PR; reviewable separately.
.github/workflows/python-package.yml), so.flake8and.prettierrc.tomlwere dead config. Rewrote.pre-commit-config.yamlto drop the legacy formatter/linter zoo (black, blackdoc, flake8, isort, prettier, pyupgrade, double-quote-string-fixer) and addedastral-sh/ruff-pre-commitso local pre-commit matches CI. Excludedtests/data/fromtrailing-whitespace/end-of-file-fixer/mixed-line-endingbecause those fixtures are byte-exact API response captures (RDB/TSV with significant trailing tabs) and must not be normalized.demos/*.ipynb,demos/hydroshare/*.ipynb, plus the non-notebookdemos/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)..rst,.nblink), README code snippets,.gitignore, the nwqn Dockerfile, and thepy.typedmarker. No behavior changes — clearing the slate so the next commit anyone makes doesn't trip the hook.Test plan
ruff check .andruff format --check .pass on the tracked tree.pre-commit run --all-filesis clean after the three commits.ruff check+ruff format --check).🤖 Generated with Claude Code