Skip to content

Rewrite cisort in Go - #2

Merged
pavel-cpp merged 1 commit into
mainfrom
go-rewrite
Oct 2, 2026
Merged

pavel-cpp merged 1 commit into
mainfrom
go-rewrite

Conversation

@pavel-cpp

Copy link
Copy Markdown
Owner

Replace the Python implementation with a Go command installable via go install github.com/pavel-cpp/cisort/cmd/cisort@latest.

  • Sort includes per blank-line block, merged, or regrouped by category, keeping line endings, BOM and all non-include lines byte for byte.
  • Understand block comments, string literals, attached and trailing comments, "cisort: off/on/keep" and "clang-format off/on" markers.
  • Put the main header (widget.cpp -> widget.h, widget_impl.h, -inl.h, .inl files, ...) and precompiled headers first; drop duplicates.
  • Built-in presets: default, alpha, google, llvm, qt, local-first, topics; .cisort.json config looked up from each file's directory upward.
  • -check, -diff, stdin/stdout mode, parallel processing, colored output and a progress bar in terminals (-no-color, -no-progress).
  • Tests with golden files per preset, CI workflow and pre-commit hooks.

Replace the Python implementation with a Go command installable via
go install github.com/pavel-cpp/cisort/cmd/cisort@latest.

- Sort includes per blank-line block, merged, or regrouped by category,
  keeping line endings, BOM and all non-include lines byte for byte.
- Understand block comments, string literals, attached and trailing
  comments, "cisort: off/on/keep" and "clang-format off/on" markers.
- Put the main header (widget.cpp -> widget.h, widget_impl.h, -inl.h,
  .inl files, ...) and precompiled headers first; drop duplicates.
- Built-in presets: default, alpha, google, llvm, qt, local-first, topics;
  .cisort.json config looked up from each file's directory upward.
- -check, -diff, stdin/stdout mode, parallel processing, colored output
  and a progress bar in terminals (-no-color, -no-progress).
- Tests with golden files per preset, CI workflow and pre-commit hooks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pavel-cpp
pavel-cpp merged commit efbb2d1 into main Oct 2, 2026
3 checks passed
@pavel-cpp
pavel-cpp deleted the go-rewrite branch October 2, 2026 11:27
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.

1 participant