Skip to content

Commit 1111b6d

Browse files
committed
merge: main into fix/pdf-scale-regression-985 to resolve conflicts in PDF coordinate transform
2 parents df861d5 + 8823e13 commit 1111b6d

29 files changed

+596
-90
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Summary
2+
- Change: <concise one-liner>
3+
- Scope: <files/modules>
4+
- Fixes: #<issue>
5+
6+
## Evidence (Verification-First)
7+
- Local tests: attach/paste `make test-ci` summary and timestamps
8+
- Coverage: attach `coverage.txt` or `gcovr` summary (with versions)
9+
- CI run URL(s): paste full Actions URLs for all required checks
10+
11+
## Risk / Compatibility
12+
- Risk: <low/med/high>
13+
- Backward-compat: <yes/no>
14+
- Notes: <migration, deprecations, perf>
15+
16+
## Reviewer Checklist
17+
- [ ] Commit title follows Conventional Commits
18+
- [ ] PR links issue and includes evidence
19+
- [ ] No skipped/disabled tests; scope is minimal and focused
20+
- [ ] CI green and reproducible locally
21+

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414

15+
- name: Root artifact hygiene check (Issue #990)
16+
run: |
17+
bash scripts/check_root_artifacts.sh
18+
1519
- name: Setup Fortran Package Manager
1620
run: |
1721
# Try multiple mirrors and retry mechanisms for resilient FPM installation
@@ -116,4 +120,4 @@ jobs:
116120

117121
# CMAKE CI test disabled - CMAKE build system removed in artifact cleanup
118122
# Issue #613: Root CMakeLists.txt removed, CMAKE example needs rework
119-
# Re-enable after CMAKE example updated to work without root build system
123+
# Re-enable after CMAKE example updated to work without root build system

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ vicky_*.pdf
9494
vicky_*.txt
9595
title_test_*.png
9696

97+
# Stray compiled test binaries that must never be tracked
98+
/test_basic_user_workflow
99+
/test_readme_promises
100+
97101
# Additional root directory artifact prevention
98102
debug_*.png
99103
debug_*.pdf

AGENTS.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
- `src/`: Fortran library sources (e.g., `backends/`, `figures/`, `utilities/`).
5+
- `test/`: FPM tests (`test_*.f90`) and artifacts under `test/output/`.
6+
- `example/`: Fortran and Python examples; generated media in `output/example/...`.
7+
- `python/fortplot/`: Python wrapper and helpers (`core.py`, `axes.py`, etc.).
8+
- `cmake/`, `Makefile`, `fpm.toml`: Build systems; docs in `doc/`, FORD config in `doc.md`.
9+
10+
## Build, Test, and Development Commands
11+
- Build (FPM): `make build` or `fpm build`.
12+
- Run examples: `make example` (Fortran), `make example_python`, `make example_matplotlib`.
13+
- Debug apps: `make debug` or `fpm run --target <app>`.
14+
- Tests: `make test` or `fpm test`; CI-fast set: `make test-ci`.
15+
- Coverage: `make coverage` (gcov/gcovr; results in `coverage.txt`).
16+
- Docs: `make doc` (FORD → `build/doc/index.html`).
17+
- Clean: `make clean`.
18+
Examples: `make test ARGS="--target test_public_api"`, `make example ARGS="basic_plots"`.
19+
20+
## Coding Style & Naming Conventions
21+
- Fortran: free-form, no implicit typing (`fpm.toml` enforces), prefer `use fortplot, only: wp => real64`.
22+
- Indentation: spaces, keep modules under ~1000 lines; group by subfolders (`backends/`, `figures/`).
23+
- Names: tests `test_*.f90`; procedures snake_case; modules end with `_t` for derived types (e.g., `figure_t`).
24+
- Python: follow PEP 8; modules split into focused files (`core.py`, `axes.py`, `advanced.py`).
25+
- Tooling: pre-commit for whitespace/EOF/YAML/TOML checks (`.pre-commit-config.yaml`).
26+
27+
## Testing Guidelines
28+
- Framework: FPM auto-discovers tests in `test/`. Name new tests `test_<topic>.f90` and keep output in `build/test/output/`.
29+
- Run subsets: `fpm test --target <name>`.
30+
- Env controls: `FORTPLOT_SUPPRESS_WARNINGS=1 make test` (quiet), `FORTPLOT_FORCE_WARNINGS=1 make test`.
31+
- Coverage: prefer `make coverage` before submitting significant changes.
32+
33+
## Commit & Pull Request Guidelines
34+
- Commits: Conventional Commits style (`feat:`, `fix:`, `docs:`, `refactor:`, `cleanup:`). Example: `fix: resolve pcolormesh dimension validation (#600)`.
35+
- PRs: concise description, link issues, list user-facing changes, include before/after images for rendering changes, and note test targets run (e.g., `test-ci`).
36+
37+
## Security & Configuration Tips
38+
- Animations require `ffmpeg` (optional). Verify with `ffprobe` if needed.
39+
- Hardened builds: trampoline checks via `fpm build --flag "-Wtrampolines -Werror=trampolines"`.
40+
- Verification: `make verify-functionality`, `make verify-size-compliance` for artifact integrity.

Makefile

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ FPM_FLAGS_LIB = --flag -fPIC
66
FPM_FLAGS_TEST =
77
FPM_FLAGS_DEFAULT = $(FPM_FLAGS_LIB)
88

9-
.PHONY: all build example debug test clean help matplotlib example_python example_matplotlib doc coverage create_build_dirs create_test_dirs validate-output test-docs verify-functionality verify-setup verify-size-compliance
9+
.PHONY: all build example debug test clean help matplotlib example_python example_matplotlib doc coverage create_build_dirs create_test_dirs validate-output test-docs verify-functionality verify-setup verify-size-compliance issue-branch issue-open-pr pr-merge pr-cleanup issue-loop issue-loop-dry
1010

1111
# Default target
1212
all: build
@@ -45,6 +45,8 @@ test-ci:
4545
@fpm test $(FPM_FLAGS_TEST) --target test_scaling || exit 1
4646
@fpm test $(FPM_FLAGS_TEST) --target test_scatter_enhanced || exit 1
4747
@fpm test $(FPM_FLAGS_TEST) --target test_histogram_functionality || exit 1
48+
@# Regression guard for Issue #985 (PDF coordinate mapping)
49+
@fpm test $(FPM_FLAGS_TEST) --target test_pdf_coordinate_mapping_985 || exit 1
4850
@echo "CI essential test suite completed successfully"
4951

5052
# Run Python examples with fortplot (default mode)
@@ -196,6 +198,48 @@ verify-with-evidence: verify-functionality
196198
@echo "Evidence directory: test/output/verification/evidence/"
197199
@ls -la test/output/verification/evidence/ || true
198200

201+
# --- GitHub issue/PR helpers for Codex loop ---
202+
issue-branch:
203+
@if [ -z "$(ISSUE)" ]; then echo "ISSUE=<number> required"; exit 2; fi
204+
@echo "Creating branch for issue #$(ISSUE)"
205+
@./scripts/issue_branch.sh $(ISSUE)
206+
207+
issue-open-pr:
208+
@if [ -z "$(ISSUE)" ]; then echo "ISSUE=<number> required"; exit 2; fi
209+
@./scripts/issue_open_pr.sh $(ISSUE)
210+
211+
pr-merge:
212+
@if [ -z "$(PR)" ]; then echo "PR=<number> required"; exit 2; fi
213+
@./scripts/pr_merge.sh $(PR) $(ARGS)
214+
215+
pr-cleanup:
216+
@if [ -z "$(PR)" ]; then echo "PR=<number> required"; exit 2; fi
217+
@./scripts/pr_cleanup.sh $(PR)
218+
219+
issue-loop:
220+
@label=$${LABEL-__all__}; \
221+
if [ "$$label" = "__all__" ]; then \
222+
./scripts/issue_loop.sh --all --limit $${LIMIT:-999999}; \
223+
else \
224+
./scripts/issue_loop.sh --label "$$label" --limit $${LIMIT:-999999}; \
225+
fi
226+
227+
issue-loop-dry:
228+
@label=$${LABEL-__all__}; \
229+
if [ "$$label" = "__all__" ]; then \
230+
./scripts/issue_loop.sh --all --limit $${LIMIT:-999999} --dry-run; \
231+
else \
232+
./scripts/issue_loop.sh --label "$$label" --limit $${LIMIT:-999999} --dry-run; \
233+
fi
234+
235+
issue-loop-auto:
236+
@label=$${LABEL-__all__}; \
237+
if [ "$$label" = "__all__" ]; then \
238+
CLEAN_FORCE=1 ./scripts/issue_orchestrate_auto.sh --all --limit $${LIMIT:-999999}; \
239+
else \
240+
CLEAN_FORCE=1 ./scripts/issue_orchestrate_auto.sh --label "$$label" --limit $${LIMIT:-999999}; \
241+
fi
242+
199243
# File size compliance verification - fraud prevention
200244
verify-size-compliance:
201245
@echo "Running file size fraud prevention verification..."

scripts/check_root_artifacts.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Check for forbidden artifacts in repository root (Issue #990)
5+
# Allowed locations: build/, doc/, output/, example/, test/, .git/
6+
7+
shopt -s nullglob
8+
9+
violations=()
10+
11+
while IFS= read -r -d '' file; do
12+
# Skip allowed paths
13+
case "$file" in
14+
./build/*|./doc/*|./output/*|./example/*|./test/*|./.git/*)
15+
continue
16+
;;
17+
esac
18+
violations+=("$file")
19+
done < <(find . -type f \( \
20+
-name "*.png" -o -name "*.pdf" -o -name "*.txt" -o -name "*.log" -o -name "*.ppm" \
21+
-o -name "*.mp4" -o -name "*.avi" -o -name "*.mkv" \) -print0)
22+
23+
# Also explicitly check for common stray executables in root
24+
for bin in ./test_basic_user_workflow ./test_readme_promises; do
25+
if [[ -f "$bin" ]]; then
26+
violations+=("$bin")
27+
fi
28+
done
29+
30+
if (( ${#violations[@]} > 0 )); then
31+
echo "ERROR: Found forbidden artifacts in repository root (Issue #990):"
32+
printf ' %s\n' "${violations[@]}" | sort -u
33+
echo "\nPlease move test outputs to test/output/ or build/ and ensure .gitignore covers these patterns."
34+
exit 1
35+
fi
36+
37+
echo "Root artifact hygiene check passed."

scripts/issue_branch.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
4+
exec "$script_dir/../../prompts/scripts/issue_branch.sh" "$@"

scripts/issue_check_relevance.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
4+
exec "$script_dir/../../prompts/scripts/issue_check_relevance.sh" "$@"

scripts/issue_loop.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
4+
exec "$script_dir/../../prompts/scripts/issue_loop.sh" "$@"

scripts/issue_open_pr.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
4+
exec "$script_dir/../../prompts/scripts/issue_open_pr.sh" "$@"

0 commit comments

Comments
 (0)