Skip to content

npmpy docstring validation against changed files in pr#173

Open
shivashanmugam wants to merge 1 commit into
mainfrom
siva/microbots-commit-validation-changed-files
Open

npmpy docstring validation against changed files in pr#173
shivashanmugam wants to merge 1 commit into
mainfrom
siva/microbots-commit-validation-changed-files

Conversation

@shivashanmugam

Copy link
Copy Markdown
Collaborator

numpy docstrings validation against changed files in a pr
.
As of now microbots have validation against all files which will report coverage without blocking the PR.
.
But with this change microbots will validate numpy docstrings only against the changes files will block if the numpy validation fails

@codecov-commenter

codecov-commenter commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.28%. Comparing base (628923c) to head (184210f).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #173   +/-   ##
=======================================
  Coverage   65.28%   65.28%           
=======================================
  Files          34       34           
  Lines        2394     2394           
=======================================
  Hits         1563     1563           
  Misses        831      831           
Flag Coverage Δ
ghcp 29.90% <ø> (ø)
integration 34.41% <ø> (ø)
ollama_local 31.95% <ø> (+0.16%) ⬆️
slow-browser 27.06% <ø> (ø)
slow-other 38.88% <ø> (+0.41%) ⬆️
unit 59.56% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the CI workflow to make NumPy docstring validation blocking for pull requests, while limiting the validation scope to only the Python files changed in the PR (under src/microbots/*.py), aligning with the existing numpydoc-validation pre-commit hook filter.

Changes:

  • Adds a new GitHub Actions job that computes changed Python files in a PR and runs pre-commit run numpydoc-validation only on those files (failing the job on violations).
  • Keeps the existing all-files docstring job as informational/non-blocking.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +114 to +123
run: |
base="${{ github.event.pull_request.base.sha }}"
head="${{ github.event.pull_request.head.sha }}"

files=$(git diff --name-only --diff-filter=ACMR "$base" "$head" \
| grep -E '^src/microbots/.*\.py$' || true)

# Collapse to a single space-separated line for use in later steps.
files=$(echo "$files" | tr '\n' ' ' | xargs || true)
echo "files=$files" >> "$GITHUB_OUTPUT"
Comment on lines +140 to +142
set +e
output=$(pre-commit run numpydoc-validation --files ${{ steps.changed.outputs.files }} 2>&1)
status=$?
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.

3 participants