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

genemichaels: init #277

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

djacu
Copy link

@djacu djacu commented Dec 10, 2024

Adds a module to use the genemichaels formatter for Rust files that is compatible with version 0.5.7.

Adds a module to use the genemichaels formatter for Rust files that is
compatible with version 0.5.7.
@djacu
Copy link
Author

djacu commented Dec 10, 2024

Hey all

I was working on this while bumping genemichaels in nixpkgs. It was just merged so this PR shouldn't be merged until the nixpkgs flake input is bumped to bring in these changes. Thought I'd share this for now so it can be reviewed until it is ready to merge.

For testing, I have already vendored this in a personal project repository and tested it. Everything appears to work as intended.

@zimbatm
Copy link
Member

zimbatm commented Dec 10, 2024

thanks Dan. Can you ping here again when the PR has reached nixos-unstable?

@djacu
Copy link
Author

djacu commented Dec 15, 2024

It appears that the latest version of genemichaels has hit unstable, however I ran into a similar issue that was seen with just in #265. genemichaels always writes the formatted file to disk even when nothing has changed and that is causing issues with tools like pre-commit.

I have submitted an issue and PR to fix the problem.
andrewbaxter/genemichaels#95
andrewbaxter/genemichaels#96

I'll work on getting this patch merged upstream and ping you when it is ready.

djacu added a commit to djacu/nixpkgs that referenced this pull request Dec 15, 2024
When formatting rust files with `genemichaels`, the timestamp of the
file is always modified whether or not the file was changed. This is
problematic for detecting whether a file has been reformatted or not,
such as when using tools such as `pre-commit`, `treefmt`, and
`treefmt-nix`.

See the following:
andrewbaxter/genemichaels#95
andrewbaxter/genemichaels#96
numtide/treefmt-nix#277
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

Successfully merging this pull request may close these issues.

2 participants