Skip to content

Port style50.vsix formatting capability over#130

Merged
rongxin-liu merged 9 commits into
mainfrom
v3
Mar 21, 2026
Merged

Port style50.vsix formatting capability over#130
rongxin-liu merged 9 commits into
mainfrom
v3

Conversation

@rongxin-liu

@rongxin-liu rongxin-liu commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Related PR: cs50/style50.vsix#12

Copilot AI review requested due to automatic review settings March 17, 2026 14:29
@rongxin-liu rongxin-liu self-assigned this Mar 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-style support and a per-run configure() hook for style checks.
  • Add CLI -o format mode plus API format_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.

Comment thread style50/_api.py
Comment thread style50/__main__.py Outdated
Comment thread style50/languages.py Outdated
Comment thread style50/languages.py
Comment thread style50/languages.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-side CLI support, and threads --clang-format-style through 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.

Comment thread style50/_api.py Outdated
Comment thread style50/_api.py Outdated
Comment thread style50/__main__.py
@rongxin-liu rongxin-liu merged commit 06e5404 into main Mar 21, 2026
1 check 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.

2 participants