-
Notifications
You must be signed in to change notification settings - Fork 3
Copier update: Sphinx #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -33,14 +33,14 @@ jobs: | |||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||
| - name: Checkout code during push | ||||||||||||||||||||||||||||||||||||
| if: ${{ github.event_name == 'push' }} | ||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v5.0.0 | ||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v6.0.1 | ||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||
| ref: ${{ github.ref_name }} # explicitly get the head of the branch, which will include any new commits pushed if this is a dependabot branch | ||||||||||||||||||||||||||||||||||||
| persist-credentials: false | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Checkout code not during push | ||||||||||||||||||||||||||||||||||||
| if: ${{ github.event_name != 'push' }} | ||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v5.0.0 | ||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v6.0.1 | ||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||
| persist-credentials: false | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
|
|
@@ -59,7 +59,7 @@ jobs: | |||||||||||||||||||||||||||||||||||
| timeout-minutes: 8 # this is the amount of time this action will wait to attempt to acquire the mutex lock before failing, e.g. if other jobs are queued up in front of it | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Cache Pre-commit hooks | ||||||||||||||||||||||||||||||||||||
| uses: actions/cache@v4.2.4 | ||||||||||||||||||||||||||||||||||||
| uses: actions/cache@v4.3.0 | ||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||
| cache-name: cache-pre-commit-hooks | ||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||
|
|
@@ -69,4 +69,11 @@ jobs: | |||||||||||||||||||||||||||||||||||
| ubuntu-24.04-py${{ inputs.python-version }}-node-${{ inputs.node-version}}-${{ env.cache-name }}- | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| - name: Run pre-commit | ||||||||||||||||||||||||||||||||||||
| run: pre-commit run -a | ||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||
| pre-commit run -a || PRE_COMMIT_EXIT_CODE=$? | ||||||||||||||||||||||||||||||||||||
| if [ -n "$PRE_COMMIT_EXIT_CODE" ]; then | ||||||||||||||||||||||||||||||||||||
| echo "Pre-commit failed with exit code $PRE_COMMIT_EXIT_CODE" | ||||||||||||||||||||||||||||||||||||
| echo "Showing git diff:" | ||||||||||||||||||||||||||||||||||||
| git --no-pager diff | ||||||||||||||||||||||||||||||||||||
| exit $PRE_COMMIT_EXIT_CODE | ||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+72
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Address shell linting warning in pre-commit step. The refactoring improves error diagnostics by capturing the pre-commit exit code and displaying git diff on failure. However, static analysis flagged an SC2086 warning (double-quote to prevent globbing/word splitting). Additionally, the exit code capture pattern using Consider this more straightforward refactor: - name: Run pre-commit
- run: |
- pre-commit run -a || PRE_COMMIT_EXIT_CODE=$?
- if [ -n "$PRE_COMMIT_EXIT_CODE" ]; then
- echo "Pre-commit failed with exit code $PRE_COMMIT_EXIT_CODE"
- echo "Showing git diff:"
- git --no-pager diff
- exit $PRE_COMMIT_EXIT_CODE
- fi
+ run: |
+ set -e
+ pre-commit run -a || {
+ EXIT_CODE=$?
+ echo "Pre-commit failed with exit code $EXIT_CODE"
+ echo "Showing git diff:"
+ git --no-pager diff
+ exit "$EXIT_CODE"
+ }Alternatively, if you prefer the current structure, ensure the exit code variable is consistently quoted: 📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.9)72-72: shellcheck reported issue in this script: SC2086:info:6:8: Double quote to prevent globbing and word splitting (shellcheck) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: LabAutomationAndScreening/pyalab
Length of output: 2451
🏁 Script executed:
Repository: LabAutomationAndScreening/pyalab
Length of output: 164
🏁 Script executed:
Repository: LabAutomationAndScreening/pyalab
Length of output: 3107
🏁 Script executed:
Repository: LabAutomationAndScreening/pyalab
Length of output: 769
🏁 Script executed:
Repository: LabAutomationAndScreening/pyalab
Length of output: 99
🏁 Script executed:
Repository: LabAutomationAndScreening/pyalab
Length of output: 97
Remove
rm -rf "./$repoName"or replace with selective cleanup—rsync--excludedoes not preserve deleted contentThe script deletes the entire repository directory on the Windows host (lines 30–31), then claims to preserve
.venvby excluding it from thersync(lines 46–50, 55–56). This is misleading: if.venvexists on the host filesystem as a directory,rm -rfdestroys it, andrsync --excludecannot restore it—exclusion only prevents overwriting, it does not recover deleted content.In the current setup,
.venvis managed as a Docker named volume (python_venv), so the practical risk is low. However, the script logic is flawed. Ifnode_modules,.pnpm-store, or.venvwere ever present on the host filesystem, they would be lost.To genuinely preserve these directories, either:
rm -rf "./$repoName"andrm -rf "./$repoName/*.md"lines entirely, lettingrsyncoverwrite only necessary files.rsync --deletewith appropriate--excludepatterns to selectively clean tracked files while preserving excluded directories.Also, the excludes for
node_modulesand.pnpm-storeare defensive: this project does not use them (only.venvvia Python). Clarify the exclusion list to match actual project dependencies.Also applies to: 46–50, 55–56
🤖 Prompt for AI Agents