Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add formatter script to sampler codebase #30

Open
RobinSattler opened this issue Jan 15, 2025 · 0 comments
Open

Add formatter script to sampler codebase #30

RobinSattler opened this issue Jan 15, 2025 · 0 comments
Assignees

Comments

@RobinSattler
Copy link
Member

I was talking with @AxelKrypton about adding a codebase formatter to the sampler repo. He proposed (since the sampler repo needs SMASH anyways to be installed) that a good solution would be to write a small formatter script which reuses SMASH’s codebase-format-helper.bash internally.

For tracking purposes a small transcript from our conversation and which steps he suggested:

  1. Change SMASH script to call the Main function only when the script is executed and not sourced. If needed, move the out-of-function lines to a function and call it accordingly.
  2. Create a new script in the sampler that is going to be the new tool.
  3. In it test the SMASH_DIR environment variable to check it points to a valid existing location.
  4. Use it to source the SMASH script. This will do nothing as only functions are sourced.
  5. Redefine the look_for_files_to_format function (I think this the only needed change) tailoring it to the sampler codebase
  6. Assemble a new Main function if needed or just call it.
@RobinSattler RobinSattler self-assigned this Jan 15, 2025
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

No branches or pull requests

1 participant