Skip to content

feat: align-use-only option (closes #12) - #13

Merged
sbryngelson merged 2 commits into
masterfrom
align-use-only
Sep 16, 2026
Merged

sbryngelson merged 2 commits into
masterfrom
align-use-only

Conversation

@sbryngelson

Copy link
Copy Markdown
Owner

Closes #12.

Adds an opt-in `align-use-only` toggle (`true` / `false` / `"preserve"`, default `false`) that aligns `only:` across consecutive `use` statements at the same indentation:

```fortran
use m_derived_types, only: t_foo
use m_global, only: a, b
use m_mpi
use m_x, only: d
```

Behavior:

  • Padding goes after the comma before `only:`.
  • A `use` without `only:` stays in the group unchanged; a blank line, comment, preprocessor line, or other statement ends the group.
  • Continuation lines of a `use` statement don't break the group, so it composes with `use-formatting = "one-per-line"`.
  • Lines that would exceed `line-length` are left alone.
  • `only:` inside a trailing comment and module names containing `only` (e.g. `m_only_stuff`) are handled; `use, intrinsic :: ...` works.
  • Respects `! ffmt off` / `! ffmt on`.

Testing: 10 new integration tests in `tests/config_integration.rs`, plus a fuzz run of 2000 randomly generated modules (mixed casing, renames, continuations, `#ifdef`/Fypp/suppression interleaved, tabs, nested scopes, random config combinations) checking no crash, idempotence, token-identical output vs. the unaligned run, and exact match against an independent reference implementation of the rule. Docs and README updated.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-16T03:14:47.853516Z cba0cc3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cba0cc3642

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/formatter.rs Resolved
@sbryngelson
sbryngelson merged commit 57f6dc3 into master Sep 16, 2026
9 checks passed
@sbryngelson
sbryngelson deleted the align-use-only branch September 16, 2026 04:04
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.

Align only: statements

1 participant