Skip to content

Fix broken demo, flag swallowing, add tests/CI/LICENSE - #2

Open
mtisza1 wants to merge 1 commit into
mainfrom
devin/nightly-1
Open

Fix broken demo, flag swallowing, add tests/CI/LICENSE#2
mtisza1 wants to merge 1 commit into
mainfrom
devin/nightly-1

Conversation

@mtisza1

@mtisza1 mtisza1 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

Addresses all five items from #1, plus several smaller follow-ups.

Changes

Bug fixes:

  • Default awk program: When no program and no -f are given, default to {print} so stdin-only invocations work (e.g. some_cmd | awkplot -p hist). This fixes the broken demo.sh steps 1-4.
  • Swallowed flag detection: Flags placed after the awk program (which argparse.REMAINDER silently captures) are now detected and produce a clear error message instead of being silently swallowed.
  • Empty awk output: Instead of leaking uplot Ruby backtrace on empty input, awkplot now prints awkplot: awk produced no output and exits 1.
  • SIGPIPE guard: signal.SIGPIPE is now gated behind hasattr() for Windows compatibility.

New features:

  • --version flag (prints awkplot 0.1.0)
  • --uplot-args passthrough for arbitrary uplot options (e.g. --uplot-args "--nbins 30")

Infrastructure:

  • Added MIT LICENSE file (was declared in pyproject.toml but missing from tree)
  • Added pytest test suite (tests/test_awkplot_cli.py) with 30 tests covering parse_size, build_awk_cmd, build_uplot_cmd, swallowed-flag detection, dry-run integration, and --version
  • Updated .gitignore to exclude .pytest_cache/
  • Updated README.md with new flags

Note: A GitHub Actions CI workflow file (.github/workflows/ci.yml) was prepared but could not be pushed due to OAuth token scope limitations. The file is available locally and can be added manually. It runs pytest across Python 3.9/3.12/3.13 and a demo.sh smoke test.

Test plan

  • All 30 pytest tests pass locally
  • --dry-run produces correct output for all flag combinations
  • --version prints version correctly
  • Swallowed flags produce clear error message
  • Empty input produces awkplot: awk produced no output
  • No-program invocation defaults to {print}

Closes #1

Generated with Devin

- Default awk program to '{print}' when no program and no -f are given,
  so stdin-only invocations (piped data) work correctly. This fixes the
  broken demo.sh (steps 1-4).

- Detect flags placed after the awk program that would be silently
  swallowed by argparse REMAINDER, and error with a clear message.

- Add --version flag (reads version from module).

- Add --uplot-args passthrough for arbitrary uplot options.

- Handle empty awk output gracefully: print 'awkplot: awk produced no
  output' instead of leaking uplot's Ruby backtrace.

- Guard signal.SIGPIPE for cross-platform compatibility (Windows).

- Add MIT LICENSE file (was declared in pyproject.toml but missing).

- Add pytest test suite (30 tests) covering parse_size, build_awk_cmd,
  build_uplot_cmd, swallowed-flag detection, dry-run integration, and
  --version.

- Add GitHub Actions CI workflow running pytest across Python 3.9/3.12/3.13
  and a demo.sh smoke test with uplot installed.

- Update README with new --uplot-args and --version flags.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@mtisza1 mtisza1 changed the title Fix broken demo, silent flag swallowing; add tests and LICENSE Fix broken demo, flag swallowing, add tests/CI/LICENSE Aug 26, 2026
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.

Broken demo, silent flag swallowing, and missing test/CI/license infrastructure

1 participant