-
Notifications
You must be signed in to change notification settings - Fork 924
Support a per-user config #837
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
Comments
This sounds like a good idea, however, I'm somewhat concerned about the utility: in order for all users of a project to get consistent formatting we must ignore such a file completely if there is a per-project file. However, if a project is using rustfmt and the defaults, then it won't have a config file, but we should still not use the user's file. That seems an impossible choice for rustfmt to make. I think it is probably easier to copy/paste a toml file into each new project. In fact this might even be done automatically - I wonder if we could change cargo to copy a user-default file when doing |
I agree with this. I don't think that formatting settings make sense in a per-user file. What might make sense is to have a template that rustfmt offers to install in the project if there is no existing project file. This would be something like git's template facility. This would be a different issue though. On reformatting comments, I suppose the best thing to do is report bugs as often as possible, and disable it in your projects in the meantime. |
I just opened #871 to track the user config for non-formatting options like |
I also filed #872 for the template idea. |
I see both of your points. Currently, leaving out
#872 will fix this for crates (use rule 1) but, unfortunately, not for single file programs. My specific use case is,
However, I may be able to fix this in emacs itself. |
I'd like to disable reformatting of my comments globally by-default because it tends to break things more often than not. To do this, rustfmt would need to support global configs. My suggestion is to read
~/.rustfmt.toml
as global override and turn it off when rustfmt is passed a--no-user-config
flag.The text was updated successfully, but these errors were encountered: