Skip to content

update formatting rules - #639

Open
superwhiskers wants to merge 2 commits into
sw/co-simulation-03from
sw/co-simulation-04
Open

superwhiskers wants to merge 2 commits into
sw/co-simulation-03from
sw/co-simulation-04

Conversation

@superwhiskers

Copy link
Copy Markdown
Collaborator

Description

this modifies some of the formatting rules to make lambda expressions a bit more readable when used inline within a function call.

Proposed changes

  • adjust continuation indentation and bracket alignment
  • apply formatting fixes across the repository

Checklist

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows GridKit™ style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • The CHANGELOG.md has been updated to reflect the changes. If this is a minor PR that is part of a larger fix already included in the file, state so.

@superwhiskers superwhiskers self-assigned this Nov 2, 2026
@superwhiskers superwhiskers added the development Features/Tools related to development of GridKit, rather than use as a library. label Nov 2, 2026
@superwhiskers
superwhiskers added this pull request to stack #637 November 2, 2026 22:53
@read-the-docs-community

read-the-docs-community Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 GridKit | 🛠️ Build #35625223 | 📁 Comparing 2810da6 against latest (9963c0d)

  🔍 Preview build  

159 files changed · + 68 added · ± 69 modified · - 22 deleted

+ Added

± Modified

- Deleted

@superwhiskers
superwhiskers force-pushed the sw/co-simulation-04 branch 2 times, most recently from 3e4eea4 to cd56c0a Compare November 3, 2026 00:57
@superwhiskers
superwhiskers force-pushed the sw/co-simulation-04 branch 2 times, most recently from 1e28421 to e4fd1fd Compare November 3, 2026 03:17
@superwhiskers
superwhiskers force-pushed the sw/co-simulation-04 branch 2 times, most recently from 9394ede to 95a64f9 Compare November 3, 2026 20:04

@nkoukpaizan nkoukpaizan 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.

I'm not convinced this is a good idea. It touches a lot of files, and makes some things harder to read in order to improve lambdas (which I usually avoid anyway).

.help = "Relative tolerance of the cost check",
.type = ArgType::Real,
.defaults = 1.0e-6}};
CliArgs args{{.name = {"--case-file", "-c"}, .help = "JSON case file", .required = true}, {.name = {"--reference-cost", "-r"}, .help = "Optimal cost to check [$/h]", .type = ArgType::Real}, {.name = {"--solver-tolerance"}, .help = "Ipopt convergence tolerance", .type = ArgType::Real, .defaults = 1.0e-6}, {.name = {"--tolerance", "-t"}, .help = "Relative tolerance of the cost check", .type = ArgType::Real, .defaults = 1.0e-6}};

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.

This reads worse than the previous version.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

there's some manual effort i need to put in to make the formatting look right because the formatter won't automatically do it. i just pushed an update of how that should look.

the reason the formatter won't do it automatically is because we unbound the maximum line length in the formatting configuration. i believe this was done to avoid touching so many files in the initial formatting approach but it has the disadvantage of not automatically doing things like the change i just made.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

if you and others are open to reversing this, i'd propose a column limit of 80. this would reduce the amount of manual effort required to make the code look nice at the cost of reformatting a lot of the codebase.

personally, i think this is worth it, but it has been brought up before

- adjust continuation indentation and bracket alignment
- apply formatting fixes across the repository
@pelesh pelesh added the wontfix This will not be worked on label Nov 4, 2026
@pelesh

pelesh commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Style changes are not priority right now and changing 300+ files is too much of a distraction at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

development Features/Tools related to development of GridKit, rather than use as a library. wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants