-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[WIP] Fixed sorted_imports rule to take into account all import declaration variants #1295
Conversation
7f41def
to
e45613b
Compare
Codecov Report
@@ Coverage Diff @@
## master #1295 +/- ##
==========================================
- Coverage 81.82% 80.27% -1.56%
==========================================
Files 181 185 +4
Lines 9112 9884 +772
==========================================
+ Hits 7456 7934 +478
- Misses 1656 1950 +294
Continue to review full report at Codecov.
|
Thanks for the PR @m-revetria! What's the state of this now? The OSSCheck comment has lots of noise so I'd rather not bang my head trying to make sense of all this if this is still work in progress. |
Hi @jpsim this is ready to go. I fixed some issues that were appearing like I forgot to update the changelog or some conflicts with the master branch. I'm not sure how to proceed with all these warnings while linting other libraries. What should I do in those cases? Thanks |
Hello @jpsim, is any progress on reviewing this? Is anything I should do in order to go forward? |
I'm just reviewing the output from OSSCheck now, and it mostly looks acceptable. Here are a few violations this introduced that I don't think are quite right:
I'm also wondering if it'd be useful to allow configuring whether |
It should ignore sorting order for rules in #ifdefs or an option to do so. For example
|
Hi @jpsim, @mlilback, I'm sorry for the long time to reply. I think we can allow developers to set what to do with
Regarding nested imports in What do you think? |
* duplicated_imports: check for duplicated imports in a file
The suggestions in your last comment make sense to me @m-revetria! |
<CommandLineArgument | ||
argument = "--config /Users/remer/Workspace/ios/swiftlint-test/.swiftlint.yml" | ||
isEnabled = "YES"> | ||
</CommandLineArgument> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you might have forgot to remove this...
Are there any plans to implement this? I think it would still be useful. |
I know this looks dead, but are there any plans for it @m-revetria ? |
@m-revetria Do you still have plans to complete this implementation? I'd be happy to review changes. If @m-revetria doesn't have the time to continue this, is there anyone else who would post a new PR with his own solution to fix #1269 (you could decide to use the code from this PR or begin yourself). Also please note, that in my opinion this PR actually should be 5 separate PRs:
|
This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions! |
Fixes #1269 & #1185.
Additionally, added two new rules:
duplicated_imports
andimports_at_top
Added
duplicated_imports
rule which checks for duplicated importsimports_at_top
rule which checks if all imports are placed at top of the file regardless of commentsFixes
sorted_imports
rule:ignore_case
option added to configuration, by default the rule will be case insensitive.class
,enum
,func
, etc., Import Declaration from Apple Docs)@testable
imports are at the end of the import list.