-
Notifications
You must be signed in to change notification settings - Fork 901
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
Feature/sliding imports #5383
base: master
Are you sure you want to change the base?
Feature/sliding imports #5383
Conversation
This reverts commit 8e5f251.
Thanks for the PR. We'll certainly consider these changes. I haven't had a chance to to review yet, but could you fix the merge conflict in report_todo = "Always"
report_fixme = "Never" |
I think we should spend some time discussing first before jumping back to the implementation. I'm not inherently opposed to considering some additional ordering strategies, but there's a lot of additional factors that needed to be talked through. First and foremost, Additionally, I've only ever seen single import directives in C and C++ and I'm not sure if more complex structures are even syntactically valid, but with Rust we'll absolutely have to account for such more complex structures, such as import statements containing trees. Such an addition would also need to be extensively tested with coverage of such scenarios, and also vectored against the other related import configuration options to validate their interactions |
Agreed that since this is a stable option we need to take additional care to maintain backwards compatibility. To that end I feel like we could implement
Handling the trees seems like a much more challenging issue. Not entirely sure how we'd handle that right now.
Agreed that solid test coverage for the new configuration options is going to be crucial! |
Once upon a time, when I was a junior developer in this c team, I had a fanatic team leader, who has preached his code style on us.
One of his principles refers to the order of the includes at the top of each file; instead of ordering them alphabetically or whatever, we had to sort them by the total length of each path:
#include <linux/bio.h>
#include <linux/uio.h>
#include <linux/blkdev.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched/task_stack.h>
Then, me and another friend moved to another team, which code in rust. Everything in this language was more than perfect, besides the lack of the "sliding includes". So, after a search for the right configuration, i decided to code this feature to the rustfmt