add astenums.d, removing over 230 lines of redundant code#12744
add astenums.d, removing over 230 lines of redundant code#12744WalterBright merged 1 commit intodlang:masterfrom
Conversation
|
Thanks for your pull request, @WalterBright! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#12744" |
thewilsonator
left a comment
There was a problem hiding this comment.
There seem to be a bunch of unrelated changes in addition to the extraction of enums.
Apart from the ASTBase duplications (cc @RazvanN7 ) this doesn't seem to be that much of a problem and do we really need more files in src/dmd?
I know. I borked up my commits. Should be fixed now.
We need more files more than we need duplication of enums. |
8bb579a to
5c26d96
Compare
It is a problem because this PR uncovered numerous inconsistencies. |
|
astbase.d in general is an endless source of irritation, but that's another matter. |
|
Every new declaration has to be added 4 times:
Naturally, error creeps in at every step. |
|
This changes it to
I don't see how that is much of an improvement. |
It is removed from astbase.d. 4 copies goes to 3. |
7465201 to
755e156
Compare
|
There's an unrelated importC commit in there. |
|
I know. I don't know how to delete it. But there are no changes from it. |
|
I figured it didn't matter anyway because off squash&merge. |
This requires the reviewer to do the right thing (and care about it) tho.
That's not really true. Someone using When dealing with commit, If you did this originally, I would have recommended to just remove the first line, save and quit. This would drop the commit. Save & quit. Your editor will re-open, and you can edit the commit message of the commit. EDIT: Word of caution: If you try to do interactive rebase of a commit that includes a merge commit, it will mess things up. |
|
@Geod24 thanks for the decent instructions. I didn't know rebase had an interactive mode. I closed my eyes and did it, and it worked :-) |
ca98af5 to
88672f1
Compare
d9a2d54 to
a4c2dcf
Compare
|
Before we do this, astbase should really be fixed first to remove all inconsistencies. Because they only highlight that astbase is wrong, not the dmd front-end code. |
|
@WalterBright this PR is an excellent example why one commit per PR is a bad rule to follow. (Yet, I agree that PRs shouldn't mix refactorings and bug fixes if possible.) In a single commit you have modified 66 (!) files which makes it quite difficult to review. Instead this PR should include a series of commits, each of which moving a single enum to Step 1 (current state): Step 2 - split the big commit into multiple smaller ones: Step 3 (optional) - you can branch at any previous commit if you want to create separate PRs: This is not about personal preferences, but about an established workflow of using Git that has proven itself extremely useful over the years across the whole industry that saves time for both the developers and the reviewers, while increasing the quality of PRs. If you're unsure how to do that, I, @Geod24, @ibuclaw @CyberShadow, @MoonlightSentinel and many others will be more than happy to help you! |
This PR is trivial to review. It's just cut&paste. Yes it modifies 66 files, including the one you asked me to modify. Nearly all of them are simply adding an import declaration. There is nothing hard about this review. But reasonable people can disagree. If anyone wants to take this PR over and spend the time altering it, I'll approve it. |
1dd6804 to
00ea214
Compare
|
@RazvanN7 this didn't address the adding even still more files. @WalterBright Well I guess I'm just going to start packaging wether you like it or not. |
I addressed it: #12744 (comment) |
|
This still adds more files, I don't see how you could have possibly addressed that. |
It's an endless source of irritation and inconsistencies to have several enums re-defined in multiple files. This pulls them out into a new file, astenums.d