Skip to content

feat: add tablassert init command to scaffold a graph project - #291

Open
ArdaTkn wants to merge 1 commit into
SkyeAv:mainfrom
ArdaTkn:feat/init-scaffold
Open

ArdaTkn wants to merge 1 commit into
SkyeAv:mainfrom
ArdaTkn:feat/init-scaffold

Conversation

@ArdaTkn

@ArdaTkn ArdaTkn commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Closes #276.

Summary

  • Add tablassert init [NAME] [--kind excel|text|parquet|ipc|ndjson] [--force] in src/tablassert/cli.py:
    • Scaffolds graph.yaml (with honest DRAFT RIG placeholders, infores:tablassert-draft), tables/table.yaml, and a sample data file in data/ for the chosen --kind.
    • Validates both Section and Graph models before writing, so tablassert validate <dir>/graph.yaml --schema graph passes immediately.
    • Refuses to overwrite existing graph.yaml or tables/table.yaml without --force, and prints a next-steps checklist.
  • Document tablassert init in docs/cli.md, docs/tutorial.md, and llms.txt, and register it in tests/test_docs_cli_coverage.py and vulture_whitelist.py.
  • Add parametrized tests for all 5 source kinds and overwrite protection in tests/test_init.py, plus an Unreleased changelog entry in CHANGELOG.md.

Local gate

  • scripts/check_changelog.py --base upstream/main: PASS
  • ruff check . / ruff format --check .: clean
  • pyright: 0 errors
  • vulture / deptry .: clean
  • mkdocs build --strict: clean
  • pytest tests/test_init.py tests/test_docs_cli_coverage.py tests/test_docs_source_of_truth.py tests/test_docs_style.py tests/test_docs_examples.py: all passed

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5bb709a9-76c4-4c13-9503-5ffcf225f5bf
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@SkyeAv SkyeAv left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for the contribution, @ArdaTkn! The config scaffolding and validation flow look good. Thinking it through, generating an example data file is probably not the best behavior for init: it suggests a runnable build even though the user still needs a fullmap and real source data. Could we remove the sample data scaffolding and keep init focused on graph.yaml and tables/table.yaml?

  • Remove the data/ sample creation in src/tablassert/cli.py:1084-1095; leave local as a placeholder path for the user to replace.
  • Update docs/cli.md, CHANGELOG.md, and tests/test_init.py so the command promises and checks only schema-valid configs and overwrite protection.
  • This also avoids format-specific gaps such as the excel branch currently writing no sample workbook.

I am updating the success metric in #276 to match this scope. The YAML scaffold and validate --schema graph flow look sound.

@ArdaTkn

ArdaTkn commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Addressed your review in 0b01322:

  • Removed data/ directory and sample data file generation from tablassert init in src/tablassert/cli.py, keeping source.local as a placeholder path (data/sample.*) for the user to replace.
  • Updated docs/cli.md, CHANGELOG.md, and tests/test_init.py so init promises and verifies only schema-valid graph.yaml + tables/table.yaml, placeholder source.local, validate --schema graph, and --force overwrite protection (plus asserting data/ is not created).

Local gates re-run and passing: check_changelog.py, ruff check, ruff format --check, pyright, vulture, deptry, mkdocs build --strict, and pytest (231 passed).

@ArdaTkn

ArdaTkn commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Also updated docs/index.md to include init in the CLI command list and added assert graph.rig is not None in tests/test_init.py for forward compatibility with #288 (ace1b33).

This branch has not been deployed

No deployments
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.

Add tablassert init to scaffold a graph project

2 participants