Skip to content

Adding tables formatting - #127

Merged
jniedzie merged 7 commits into
mainfrom
devel_jeremi
Sep 21, 2026
Merged

jniedzie merged 7 commits into
mainfrom
devel_jeremi

Conversation

@jniedzie

@jniedzie jniedzie commented Sep 1, 2026

Copy link
Copy Markdown
Owner

No description provided.

@jniedzie
jniedzie requested review from twybo and a lite review from Copilot September 1, 2026 15:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

There is an import-time error in an example config and some formatting/tooling settings are currently unreliable across environments.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR introduces a Python “table” formatter for aligning repeated tuple/call rows (e.g., config tables), integrates it into pre-commit + CI, and updates various template/example configs to use the aligned layout with # fmt: off/on guards so Ruff formatting won’t undo the alignment.

Changes:

  • Add scripts/format_python_tables.py plus CI regression tests to keep formatting stable.
  • Wire the formatter into .pre-commit-config.yaml and run its tests in GitHub Actions CI.
  • Reformat multiple template/example config tables and adjust VS Code template formatting settings.
File summaries
File Description
templates/histogrammer_config.template.py Reformat default/custom histogram tuple tables for alignment.
templates/config.template.py Reformat histogram tables and branchesToAdd rows; add spacing around guarded regions.
templates/.vscode/settings.json Add tuple-table-formatter settings and change Python default formatter selection.
scripts/format_python_tables.py New formatter script that aligns “table-like” repeated tuple/call rows and inserts # fmt: off/on.
configs/examples/skimmer_config.py Align branchesToAdd rows and add # fmt: off/on guards.
configs/examples/plotter_config.py Collapse multi-line Histogram(...) calls into aligned one-line rows with fmt guards.
configs/examples/minimal_plotter_config.py Align histogram table and add fmt guards.
configs/examples/minimal_histogrammer_config.py Align default histogram tuple table.
configs/examples/limits_config.py Reformat background sample rows with fmt guards (but currently introduces an error).
configs/examples/histogrammer_config.py Align histogram tuple tables and add fmt guards around them.
configs/das_exercises/task7_plotting.py Align histogram definitions with fmt guards.
configs/das_exercises/task4_advanced_histograms.py Align default histogram tuple table with fmt guards.
configs/das_exercises/task2_plotting.py Align histogram definitions with fmt guards.
ci/test_format_python_tables.py New unit/regression tests for the formatter script.
.pre-commit-config.yaml Add a local pre-commit hook to run the formatter.
.github/workflows/ci.yml Run formatter unit tests during CI.
Review details
  • Files reviewed: 14/16 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread configs/examples/limits_config.py Outdated
Comment thread .pre-commit-config.yaml
Comment thread templates/.vscode/settings.json Outdated
Comment thread scripts/format_python_tables.py
jniedzie and others added 3 commits September 2, 2026 13:47
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@twybo twybo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

see other comments
Why hasnt the format CI not run succesfully?

@jniedzie
jniedzie requested review from twybo and removed request for twybo September 18, 2026 09:08

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is this table formatting related?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

nope, unrelated

Comment thread scripts/format_python_tables.py Outdated
@jniedzie
jniedzie requested a review from twybo September 21, 2026 13:00
@jniedzie
jniedzie merged commit a6ee935 into main Sep 21, 2026
4 checks passed
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.

3 participants