Port style50.vsix formatting capability over#130
Conversation
… 'format' output mode
There was a problem hiding this comment.
Pull request overview
Ports formatting capabilities from the style50 VSIX into the core CLI/library, adding formatters for additional languages and a new CLI output mode for emitting formatted source.
Changes:
- Add HTML/CSS/SQL formatting support (djhtml/cssbeautifier/sqlparse).
- Add
--clang-format-stylesupport and a per-runconfigure()hook for style checks. - Add CLI
-o formatmode plus APIformat_file(), and bump package version to 3.0.0 with new dependencies.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| style50/languages.py | Adds HTML/CSS/SQL style checks and introduces clang-format style override support for C-derived checks. |
| style50/_api.py | Adds clang_format_style plumbing, format_file(), and invokes optional configure() hook before checks run. |
| style50/main.py | Adds format output mode and --clang-format-style CLI flag. |
| setup.py | Adds new formatter dependencies and bumps version to 3.0.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…formatter returns newline consistently. Add tests for new behavior.
There was a problem hiding this comment.
Pull request overview
This PR ports “formatting mode” capabilities into style50, adding a CLI/API path to emit formatted code (or rewrite files in place) and expanding formatter support beyond the existing languages to better match the VS Code extension’s needs.
Changes:
- Adds
output=format+--in-place/--side-by-sideCLI support, and threads--clang-format-stylethrough the API. - Introduces new formatters for HTML (djhtml), CSS (cssbeautifier), and SQL (sqlparse), plus tests for formatter invocation and clang-format flag preservation.
- Updates packaging/CI to install test extras and run pytest.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
style50/__main__.py |
Adds format mode, --in-place, --side-by-side, --clang-format-style, and updates argument wiring. |
style50/_api.py |
Adds format_file() / format_files_in_place(), threads clang_format_style into checks, and guards run() in format mode. |
style50/languages.py |
Adds HTML/CSS/SQL formatters and clang-format style override behavior in C (preserving subclass flags). |
tests/test_languages.py |
Unit tests for new formatters and clang-format override behavior. |
tests/test_cli.py |
CLI integration tests for format mode, in-place rewriting, ignore patterns, and flag conflicts. |
setup.py |
Adds new formatter dependencies + test extras and bumps version to 3.0.0. |
.github/workflows/main.yml |
Runs pytest in CI via pip install '.[test]'. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Related PR: cs50/style50.vsix#12