Skip to content

chore(ci): improve local taskfile portability, gitignore, and examples workflow - #175

Closed
adcondev wants to merge 2 commits into
masterfrom
chore/tooling-and-ci-hygiene
Closed

adcondev wants to merge 2 commits into
masterfrom
chore/tooling-and-ci-hygiene

Conversation

@adcondev

Copy link
Copy Markdown
Owner

Overview

Housekeeping improvements to developer tooling, git hygiene, pre-commit configuration, and CI examples validation.

Key Changes

  1. Taskfile.yml Portability: Dynamically detect ThreadSanitizer support (go test -race ./internal/calculate) so task test and task build run smoothly on ARM64 Linux kernels with 47-bit VMA while preserving -race on 48-bit VMA and x86_64 CI runners.
  2. .gitignore Hygiene: Added bin/ and node_modules/ to avoid untracked build artifacts and optional npm tool caches.
  3. Branch Protection in Pre-Commit: Updated no-commit-to-main hook in .pre-commit-config.yml to protect master (the repository's default branch) as well as main, and relaxed local go-tests hook from hardcoded -race to portable -short.
  4. Examples CI Workflow: Fixed .github/workflows/examples.yml to trigger on master and build all examples with go build -v ./examples/... directly from repository root instead of attempting invalid submodule downloads.

Verification

  • task test: Passed (all packages tested with coverage)
  • task lint: Passed (0 issues)
  • task build: Passed (produces ./bin/poster cleanly)
  • go build ./examples/...: Passed (all 9 examples compile cleanly)

…s workflow

- Dynamically detect ThreadSanitizer support in Taskfile.yml to avoid VMA range crashes on ARM64 Linux kernels while preserving -race on CI.
- Add bin/ and node_modules/ to .gitignore.
- Protect both master and main branches in .pre-commit-config.yml and use portable -short test flag.
- Update .github/workflows/examples.yml to trigger on master and compile all examples directly from module root.
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for opening this PR, @adcondev!

Here's what will happen next:

  • 🤖 Automated checks will run
  • 🏷️ Labels will be added automatically
  • 👀 A maintainer will review your changes

Please make sure:

  • ✅ All tests pass
  • 📝 The PR title follows conventional commits
  • 📋 The PR template is filled out completely

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

⚡ Benchmark Results

📈 Performance Comparison

📊 Click to expand detailed results

Current Branch Results

BenchmarkNewDocument-4    	1000000000	         0.3139 ns/op	       0 B/op	       0 allocs/op
BenchmarkBuildSimple-4    	 3618714	       338.5 ns/op	     240 B/op	       4 allocs/op
BenchmarkBuildComplex-4   	  379497	      2930 ns/op	    1856 B/op	      29 allocs/op
BenchmarkToJSON-4         	  533150	      2087 ns/op	     592 B/op	       3 allocs/op
BenchmarkParseDocument_Minimal-4    	  514740	      2346 ns/op	     568 B/op	      14 allocs/op
BenchmarkParseDocument_Receipt-4    	   91411	     12979 ns/op	    2392 B/op	      34 allocs/op
BenchmarkCommandUnmarshal_Text-4    	  411975	      2806 ns/op	     568 B/op	      19 allocs/op
BenchmarkCommandUnmarshal_Table-4   	  265257	      4342 ns/op	     952 B/op	      22 allocs/op
BenchmarkTextCommandParsing-4       	  520632	      2177 ns/op	     544 B/op	      16 allocs/op
BenchmarkTableCommandParsing-4      	  237244	      4916 ns/op	    1000 B/op	      31 allocs/op
BenchmarkParseHexString-4           	 8449798	       140.2 ns/op	      48 B/op	       2 allocs/op
BenchmarkCleanHexString-4           	 7451894	       159.4 ns/op	      64 B/op	       2 allocs/op
BenchmarkContainsSequence-4         	295292382	         4.087 ns/op	       0 B/op	       0 allocs/op
BenchmarkCheckCriticalCommands-4    	34643200	        39.21 ns/op	       0 B/op	       0 allocs/op
BenchmarkDocument_Validate-4       	14358002	        82.91 ns/op	       0 B/op	       0 allocs/op
BenchmarkParseDocument_Simple-4    	  497272	      2433 ns/op	     568 B/op	      14 allocs/op
BenchmarkParseDocument_Complex-4   	  137162	      8638 ns/op	    1352 B/op	      26 allocs/op
BenchmarkPrintImage_Small-4             	     598	   1983994 ns/op	 3469940 B/op	      24 allocs/op
BenchmarkPrintImage_Medium-4            	     312	   3856506 ns/op	 5481087 B/op	      24 allocs/op
BenchmarkPrintImage_ThermalPreview-4    	     138	   8693169 ns/op	 5231181 B/op	  230423 allocs/op

Base Branch Results

BenchmarkNewDocument-4    	1000000000	         0.3127 ns/op	       0 B/op	       0 allocs/op
BenchmarkBuildSimple-4    	 3550137	       336.7 ns/op	     240 B/op	       4 allocs/op
BenchmarkBuildComplex-4   	  386359	      2940 ns/op	    1856 B/op	      29 allocs/op
BenchmarkToJSON-4         	  533786	      2083 ns/op	     592 B/op	       3 allocs/op
BenchmarkParseDocument_Minimal-4    	  506031	      2331 ns/op	     568 B/op	      14 allocs/op
BenchmarkParseDocument_Receipt-4    	   90703	     12928 ns/op	    2392 B/op	      34 allocs/op
BenchmarkCommandUnmarshal_Text-4    	  407156	      2758 ns/op	     568 B/op	      19 allocs/op
BenchmarkCommandUnmarshal_Table-4   	  268423	      4331 ns/op	     952 B/op	      22 allocs/op
BenchmarkTextCommandParsing-4       	  510938	      2176 ns/op	     544 B/op	      16 allocs/op
BenchmarkTableCommandParsing-4      	  237705	      4929 ns/op	    1000 B/op	      31 allocs/op
BenchmarkParseHexString-4           	 8394156	       143.5 ns/op	      48 B/op	       2 allocs/op
BenchmarkCleanHexString-4           	 7440158	       159.8 ns/op	      64 B/op	       2 allocs/op
BenchmarkContainsSequence-4         	295461321	         4.111 ns/op	       0 B/op	       0 allocs/op
BenchmarkCheckCriticalCommands-4    	33610641	        34.90 ns/op	       0 B/op	       0 allocs/op
BenchmarkDocument_Validate-4       	14542284	        84.64 ns/op	       0 B/op	       0 allocs/op
BenchmarkParseDocument_Simple-4    	  494328	      2437 ns/op	     568 B/op	      14 allocs/op
BenchmarkParseDocument_Complex-4   	  136597	      8667 ns/op	    1352 B/op	      26 allocs/op
BenchmarkPrintImage_Small-4             	     586	   2007268 ns/op	 3469945 B/op	      24 allocs/op
BenchmarkPrintImage_Medium-4            	     312	   3822868 ns/op	 5481083 B/op	      24 allocs/op
BenchmarkPrintImage_ThermalPreview-4    	     135	   8950383 ns/op	 5231179 B/op	  230423 allocs/op

💡 Note: Use benchstat for statistical comparison

🎯 Summary

  • Total Benchmarks: 32
  • Average Speed: 2642799 ns/op
  • Average Memory: 2396767 B/op
  • Average Allocations: 41077 allocs/op

…cure path validation

- Resolve symlinks on baseAbs before joining target in SecureFilepath.
- Use filepath.Rel for robust containment checking across operating systems.
- Canonicalize tempDir in TestSecureFilepath to prevent false failures on macOS (/var -> /private/var) and Windows short paths.
@github-actions github-actions Bot added the tests label Oct 19, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity.
It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale label Nov 3, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed due to inactivity.
If you'd like to continue working on this, please feel free to reopen it.

@github-actions github-actions Bot closed this Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant