GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Improve runastyle scripts and update astyle version by jcfr · Pull Request #508 · cppcheck-opensource/simplecpp

Conversation

@jcfr

@jcfr jcfr commented Aug 25, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This pull request improve the runastyle scripts for easier use:

  • Ensure the scripts can be executed from any location.
  • Centralize astyle configuration with a .astylerc file.
  • Require astyle 3.4.13 (also available on PyPI) to preserve current formatting; newer 3.6.9 alters continuation-line indentation.
  • Add support for command runners like pipx and uvx if astyle is not available in the PATH.
  • Simplify the batch script with "@echo off" and proper error handling.
  • Combine astyle invocations for .h and .cpp files into a single command.
  • Format source files according to the updated style guidelines.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
jcfr added 9 commits August 25, 2025 19:23
@jcfr
chore: Ensure runastyle scripts can be executed from any location
aa77332
This change updates the runastyle scripts to set the working directory to the
script's directory, ensuring consistent behavior regardless of the initial
execution location.
@jcfr
chore: Support astyle IDE integration and de-duplicate settings
5c791a4
This change introduces a `.astylerc` configuration file to centralize and
simplify the astyle settings for both the runastyle script and IDE integration.
@jcfr
style: Format sources using astyle 3.0.1
da16a44
This change applies code formatting to the source files using astyle version
3.0.1 according to the project's style guidelines.
@jcfr
chore: Refactor runastyle scripts to support future runners (pipx, uvx)
3bba884
This refactor introduces a dedicated `ASTYLE_VERSION` variable (formatted as
`X.Y.Z`) and derives `ASTYLE_VERSION_STR` automatically. This separation makes
it clearer where to update the required version and ensures consistency across
platforms.

The change simplifies maintenance and prepares the scripts for use with command
runners such as `pipx` or `uvx`.
@jcfr
chore: Simplify runastyle.bat by using "@echo OFF"
ca3ed55
This change simplifies the Windows batch script by using "@echo OFF" to
reduce unnecessary output, making the script cleaner and easier to read.
@jcfr
chore: Fix runastyle.bat by adding missing EXIT_ERROR label
e55ca92
This change adds the missing `EXIT_ERROR` label to the `runastyle.bat` script,
ensuring proper error handling and exit status.
@jcfr
chore: Require astyle 3.4.13 and switch to --project
421b688
- Bump required astyle from 3.0.1 to 3.4.13 to enable easy installs via
  pipx/uvx from PyPI.
- Keep formatting stable: 3.4.13 matches our current output, whereas 3.6.9
  changes continuation-line indentation (e.g., after &&).
- Use `--project` (available since 3.2) instead of `--options` to simplify
  config discovery.

No formatting diffs expected with the current `.astylerc`
@jcfr
chore: Add fallback to run astyle via uvx or pipx if not found in PATH
b3d385d
This change improves the runastyle scripts to support multiple ways of invoking
astyle.
@jcfr
chore: Simplify runastyle script by invoking executable once
7e499d3
This change simplifies the runastyle script by combining the invocation
of the astyle executable for both .h and .cpp files into a single command.
@jcfr

jcfr commented Aug 25, 2025

Copy link
Copy Markdown
Contributor Author

While working on finalizing #448, I realized that astyle integration could be further improved to simplify the developer experience.

Once this is integrated, I suggest we also introduce a workflow running astyle

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave

firewave commented Aug 26, 2025

Copy link
Copy Markdown
Collaborator

Cppcheck has moved to uncrustify quite a while ago, so simplecpp should probably do the same.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jcfr

jcfr commented Aug 26, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the review.

so simplecpp should probably do the same.

Given limited bandwidth, I will not be able to switch to uncrustify. In the meantime, I think moving forward with this may be sensible as it allow contributor to apply the formatting.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@firewave

firewave commented Aug 26, 2025

Copy link
Copy Markdown
Collaborator

I leave that up to @danmar.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jcfr

jcfr commented Aug 26, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the taking the time to review 🙏

While I understand we could switch to uncrustify or clang-format, I think this is a sensible improvement to streamline contributions. The use of alternative formatters or linters could definitely be done in follow-up pull requests.

Once the GitHub workflow have been enabled and the test pass, I believe this will be ready for integration 🚀

cc: @danmar @firewave

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@danmar

danmar commented Aug 28, 2025

Copy link
Copy Markdown
Collaborator

Thank you for this contribution but I fear that I feel we should switch to uncrustify instead asap. If you don't have the bandwidth I understand. But we more or less just need to copy the runformat script from the cppcheck repo and reuse all the options..

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@danmar danmar closed this Aug 28, 2025
@jcfr

jcfr commented Aug 28, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback. I agree that moving to uncrustify makes sense long-term, and I understand the idea of reusing the runformat script from the cppcheck repo.

In the meantime, I believe these small changes still help streamline the contribution process for new contributors. To keep things clear and incremental, I’ll follow up with two pull requests:

  • One with this commit: da16a44d (style: Format sources using astyle 3.0.1)
  • One removing all remaining references to astyle, since the current instructions are outdated and misleading.

This way the repo stays consistent and contributors won’t be confused by stale formatting instructions while the switch to uncrustify is being worked out.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Aug 28, 2025
style: Format sources using astyle 3.0.1 #515
Closed
chore: Remove obsolete runastyle scripts #516
Closed
chore: Improve attribution by ignoring bulk formatting #518
Merged
@jcfr
jcfr deleted the improve-runastyle-scripts branch August 29, 2025 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@jcfr @firewave @danmar
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.