-
Notifications
You must be signed in to change notification settings - Fork 30
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
Proposed fix: configuring and formatting project. #229
Conversation
Thank you for the pull request! Yes... much of the I was not in the habit of applying But yes, it is problematic that running I've investigated other solutions.
unstable_features = true
format_generated_files = false After all, this is also an unstable feature, so running it with |
I see, so those seem to be the best options, huh?
That being said, I wonder if it would be possible to automate this into the workflow? Something similar to how In particular, I find the 3rd option the most appealing, even if the stable option (passing through command line) ends up not working for some reason, it still seems fairly better than the other options. The Alright, I think we could work this out. Tell me your thoughts, and after testing a few things, we could make a decision. Looking forward to it! |
fmm, |
f3e4fbf
to
c20b087
Compare
Ok! I think it's good to go. Seems like it worked just fine. The next step would be making github actions to run |
Thank you for the update! Please let me know if you know of any rust projects that might be of help regarding formatting guidelines. |
I think that's a good idea, yeah! But considering formatting is automatic, maybe there's a way to immediately format the branch while merging? About the Rust project you asked, I can't think of anything right now, but I'll see if I can find anything good. |
Okay, I found one that seems promising. They also seem to have some extra configuration for linting at Github Workflows also seem to be properly configured, their CI includes actions for There's also something really cool they did. They're using |
Thank you for investigating! Perhaps As So, the remaining work to be done on this branch is:
is that correct? |
Yes, I think so! Those three, plus adding |
FYI. |
Oh, right, hahah. Okay! |
Ok, I have finished the pending tasks. However, before we merge this, I wanted to ask something. I was thinking maybe it would be better to merge the More specifically, I was thinking of putting it immediately before
What do you think? |
Another thing I was thinking is, maybe we should configure global lints for this workspace (although I think it would be better to do this on a separate Pull Request). |
It certainly doesn't need to be separated into rust.yml and I've never configured ATrium is currently on MSRV 1.70 (background on that is #100) and unless this is updated, the lints setting will probably be ignored even if it is. |
Since they were the author of the mentioned PR (#100), I'd like to call them here to hear their opinion as well, as their input will be valuable. @str4d, I summon you hehe. I was looking at That way, we will be able to configure lints, and also remove If you both approve this change, I'll be creating two new issues: one to bump MSRV and remove async-trait, another one to configure the lints. I'd like to hear what you have to say! |
I'm fine with bumping MSRV to 1.75. I target N - 4 as the "most recent MSRV" for my own projects, which is around 6 months or so. |
All right. Thanks for your input! Also @sugyan, on another topic, if everything in this PR is OK for you, I think it's ready to be merged 👍🏻 |
Thank you both! OK, let's bump up the MSRV to 1.75. By the way, |
@sugyan yes, correct. I configured the option and forgot to run I pushed a new commit. Should be good now! |
Thank you. |
Thanks for being receptive! <3 Yes, I'm also not fully used to them but I honestly think it's better and looks cleaner this way. It's easier to read too, so I decided it was worth a shot. I hope we can both get used to it quick! |
This Pull Request:
.editorconfig
andrustfmt.toml
, which are config files to ensure consistent formatting throughout the whole project;@generated
annotation to all generated files + creating cargo alias forcargo fmt
to skip those files;rustfmt
to run with the CI + adds a Problem Matcher to improve output.Hello @sugyan! Good day.
I'm making this PR because I ran into an annoying issue. I routinely use
cargo fmt
to ensure consistent formatting in my code, but I noticed that the code onatrium-api
wasn't properly formatted. Therefore, I added two configuration files that hint to our IDEs andcargo fmt
how it should format files. That ensures consistent formatting, which is an overall code improvement.I highly recommend merging this into main, as well as running
cargo fmt
before anygit push
, if your IDE doesn't do it by default.I would love to hear your thoughts on it!
P.S.: If you don't like the current style of formatting, you can look into the definitions for both of these files and we can update them and see how that looks, how is that for you? Also, if I remember correctly, there are ways to override the formatting style for specific folders. Since
atrium-api
is generated code, it might come in handy!