Refactor and docs: fix typo, reformat code, update README#1009
Refactor and docs: fix typo, reformat code, update README#1009v1k1nghawk wants to merge 4 commits intointel:masterfrom
Conversation
v1k1nghawk
commented
Apr 1, 2026
- Fix typo in print_output()
- Convert indentation from tabs to spaces for consistency (according to project's Coding Style)
- Update README.md to include more user-friendly robust instructions for build directory creation, otherwise, if a user would like to repeat the step they will get an error: "mkdir: cannot create directory ‘build’: File exists" because the directory persists from a previous attempt
README.md
Outdated
|
|
||
| ``` | ||
| mkdir build | ||
| rm -rf build && mkdir build |
There was a problem hiding this comment.
It is probably good to mention here that one can use mkdir -p here to prevent a full rebuild. If one wants a full rebuild then delete it all and start over.
There was a problem hiding this comment.
Agreed. Mentioned both cases as suggested.
|
Regarding the rest of the changes, I've discussed this with @rdementi in the past but it is probably better to change indentation only there where you make actual changes. |
1cf43ec to
735d63d
Compare
- Fix typo in print_output() - Convert indentation from tabs to spaces for consistency (according to project's Coding Style) - Update README.md to include more robust instruction for build directory creation
735d63d to
09ed30d
Compare
Thank you for the clarification, I've reverted the indentation changes from the PR. |
There was a problem hiding this comment.
Pull request overview
This PR cleans up user-facing documentation and messaging by correcting a metric description typo in the PCM output and improving the README build instructions to avoid common “build directory already exists” errors.
Changes:
- Fixes a typo in the
UTILmetric description printed byprint_output(). - Updates README build steps to include options for reusing vs. recreating the
build/directory.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/pcm.cpp |
Corrects a typo in the printed UTIL description string. |
README.md |
Adds build-directory setup guidance (incremental vs. clean build) before the compile steps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
README.md
Outdated
| * Quick Update: Run `mkdir -p build` to skip a full rebuild and preserve existing build artifacts. | ||
| * OR | ||
| * Clean Start: Run `rm -rf build && mkdir build` to do a full rebuild. |
There was a problem hiding this comment.
The "* OR" line renders as a third bullet item, which can look like an instruction step rather than a separator between the two options. Consider using plain text (e.g., "or") or restructuring the list (e.g., numbered options) to make the mutually exclusive choice clearer.
| * Quick Update: Run `mkdir -p build` to skip a full rebuild and preserve existing build artifacts. | |
| * OR | |
| * Clean Start: Run `rm -rf build && mkdir build` to do a full rebuild. | |
| 1. Quick Update: Run `mkdir -p build` to skip a full rebuild and preserve existing build artifacts. | |
| 2. Clean Start: Run `rm -rf build && mkdir build` to do a full rebuild. |
README.md
Outdated
| Compile: | ||
| ``` | ||
| mkdir build | ||
| cd build | ||
| cmake .. | ||
| cmake --build . |
There was a problem hiding this comment.
The compile snippet now starts with cd build but no longer includes any build directory creation command in the code block. A copy/paste of the "Compile" block alone will fail on a fresh checkout (or if the user skips the section above). Consider including the chosen directory-creation command in the fenced block(s) or otherwise making the required step unmissable.
There was a problem hiding this comment.
I think it is ok this way, Copilot does have a point that in the Compile section there is no mkdir build so you might move the comment into the compile section but before the ``` line. This is up to you though, i can live with this without.
There was a problem hiding this comment.
Let's take Copilot's suggestion, I've updated the section to include it.
Quick Update rephrasing Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
README.md
Outdated
| * Clean Start: Run `rm -rf build && mkdir build` to do a full rebuild. | ||
|
|
||
| Compile: | ||
| then compile: |
There was a problem hiding this comment.
If you have done a previous build you do not need to do a mkdir -p build because it exists, you can go straight to the "cd build" step.
So something like this perhaps?
On first build or in case you want to throw everything away and start from scratch then start with this:
rm -rf build && mkdir build
If you have a previous build and want to continue building with that then you can skip the deletion of the build directory.
cd build
There was a problem hiding this comment.
Yes, sounds logical. I've rephrased the statements based on those suggestions. Thanks!
|
|
||
| Choose **one** of the following build methods: | ||
| * Incremental Build (Fastest): if you have a previous build to reuse the existing `build` directory and preserve previous build artifacts, go straight to the `cd build` step. | ||
| * Clean Build (From Scratch): Run `rm -rf build && mkdir build` for your first build, or for a full rebuild to ensure a "clean state" by deleting all previous build data. |
There was a problem hiding this comment.
does this work on Windows? the expectation is that it works on both *nix/BSD-like OSes and Windows