This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 889
Ordered imports grouping #4134
Merged
adidahiya
merged 9 commits into
palantir:master
from
abierbaum:ordered_imports_grouping
Jan 29, 2019
Merged
Ordered imports grouping #4134
adidahiya
merged 9 commits into
palantir:master
from
abierbaum:ordered_imports_grouping
Jan 29, 2019
Commits on Jan 15, 2019
-
Extend orderd-import rule with support for custom grouping.
- Add configuration to support defining custom groups and ordering - Set a default grouping that replications the previous functionality of grouped-imports
Configuration menu - View commit details
-
Copy full SHA for bb9beab - Browse repository at this point
Copy the full SHA bb9beabView commit details -
Configuration menu - View commit details
-
Copy full SHA for e442835 - Browse repository at this point
Copy the full SHA e442835View commit details -
Configuration menu - View commit details
-
Copy full SHA for 12c633d - Browse repository at this point
Copy the full SHA 12c633dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 67ac042 - Browse repository at this point
Copy the full SHA 67ac042View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5bf1056 - Browse repository at this point
Copy the full SHA 5bf1056View commit details
Commits on Jan 16, 2019
-
Add comments and adjust internal variable naming.
- added comments in an attempt to describe to others how the code is working. - update variable names to be a bit more clear about what is being tracked within the code.
Configuration menu - View commit details
-
Copy full SHA for e68c575 - Browse repository at this point
Copy the full SHA e68c575View commit details -
Update orderedImports for standalone groups and source-order any
This change updates the refactored "group" based orderedImports code to handle the cases fixed in the following previous PRs: - palantir#4374: fixed grouping for import-sources-order - palantir#3733: check all imports of same type are grouped As part of this we removed the concept of ImportType as this is now covered by the defined groups for sorting. Moved the check for ensuring groups are not standing alone into the code checkBlocksGroup() code where other group checks are done. Ex: ``` import './baa'; import './baz'; import './caa'; // this should fail ``` Also had to update several other test cases to include the failure notice about import groups needing to be together.
Configuration menu - View commit details
-
Copy full SHA for d293ec8 - Browse repository at this point
Copy the full SHA d293ec8View commit details
Commits on Jan 26, 2019
-
Updates from review: grouping message, match name
- Change the message shown when items are not grouped as expected The new message is more clear and understandable - Use a better default group name If a group has a regex and no name, the default name is now: /regex/ This makes it more clear in the output that it is a regex and helps to keep the boundaries of the regex string more clear.
Configuration menu - View commit details
-
Copy full SHA for 1b65471 - Browse repository at this point
Copy the full SHA 1b65471View commit details -
Remove check for grouping imports together by group.
This check is already handled by the check for groups needing to be sorted. The idea is that once the first block of imports is found that has an import that is out of order, then all future blocks also have blocks out of order. So instead of flagging all blocks we just flag the first block that is causing the issue and provide a fix that will fix all blocks. This makes the case for manually fixing the import ordering much more clear because people can solve one item at a time. The automattic fixing is also more clear because we don't end up with multiple failures that have the same fix.
Configuration menu - View commit details
-
Copy full SHA for 82027be - Browse repository at this point
Copy the full SHA 82027beView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.