-
Notifications
You must be signed in to change notification settings - Fork 20
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
fix: preserve line comments on creating/ modifying rust code #382
Merged
c12i
merged 8 commits into
holochain:develop
from
c12i:fix/preserve-comments-on-modifying-rust-code
Oct 4, 2024
Merged
fix: preserve line comments on creating/ modifying rust code #382
c12i
merged 8 commits into
holochain:develop
from
c12i:fix/preserve-comments-on-modifying-rust-code
Oct 4, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… apply to map_rust_files function
c12i
changed the title
fix: preserve comments on modifying rust code
fix: preserve line comments on modifying rust code
Oct 2, 2024
c12i
changed the title
fix: preserve line comments on modifying rust code
fix: preserve line comments on creating/ modifying rust code
Oct 2, 2024
matthme
approved these changes
Oct 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
c12i
removed
the
ShouldBackport/0.3
This change should be backported to develop-0.3
label
Oct 17, 2024
c12i
added a commit
to c12i/scaffolding
that referenced
this pull request
Oct 17, 2024
…in#382) * Refactor un_parse_pretty function * Move important scaffold functions to the top of the module for easy accesss * fix improper use of bool.then_some * ensure line comments are preserved * derive a convert rust line comments to doc comments util function and apply to map_rust_files function * ensure initially generated comments are correctly formatted * remove unnecessary inline attribute on unparse_pretty * Replace once_cell::Lazy with standard lib LazyLock
c12i
added a commit
that referenced
this pull request
Oct 22, 2024
* feat: add optional cli flag to skip test code generation (#381) * Bump crate version * fix: preserve line comments on creating/ modifying rust code (#382) * Refactor un_parse_pretty function * Move important scaffold functions to the top of the module for easy accesss * fix improper use of bool.then_some * ensure line comments are preserved * derive a convert rust line comments to doc comments util function and apply to map_rust_files function * ensure initially generated comments are correctly formatted * remove unnecessary inline attribute on unparse_pretty * Replace once_cell::Lazy with standard lib LazyLock * fix: Optimize nix flake (#384) * optimize nix flake * Supress clippy warnings * nix flake update * Replace LazyCell with once_cell::Lazy * Cargo update dprint-plugin-typescript
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR ensures line comments are preserved on modifying or creating new rust files while running scaffold commands that do so.
While this PR addresses the problem, it does open up another issue which I think is tolerable for now: Developer manually written doc comments
///
will end up getting converted to line comments//
on running scaffolding commands that modify this file. While the comments will still be retained, they will take on a different format. I think this minor hiccup is tolerable, I will open up another issue so that we can keep track of it an make developers aware of this peculiarity.Extra changes:
bool.then_some
Fixes #167
Fixes holochain/Components#47