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

False positive modifier_order violation when explicit order is not specified #2435

Closed
biboran opened this Issue Oct 8, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@biboran
Copy link
Contributor

biboran commented Oct 8, 2018

New Issue Checklist

Describe the bug

False positive modifier_order violation is reported when final keyword precedes public keyword if order between two is not specified explicitly.

As far as I understand the rule it should only validate the ordering between keywords specified by the configuration keyword groups and leave unspecified declarations in place.

Complete output when running SwiftLint, including the stack trace and command used

Here is the config

whitelist_rules:
  - modifier_order

modifier_order:
  preferred_modifier_order:
    # - final #uncommenting this makes the violation go away
    - override
    - acl

Here is the output

echo 'final public class Foo { }' | swiftlint lint --no-cache --use-stdin
Loading configuration from '.swiftlint.yml'
<nopath>:1:14: warning: Modifier Order Violation: public modifier should be before final. (modifier_order)
Done linting! Found 1 violation, 0 serious in 1 file.

Environment

  • SwiftLint version (run swiftlint version to be sure)?

0.27.0

  • Installation method used (Homebrew, CocoaPods, building from source, etc)?

building from source

  • Which Xcode version are you using (check xcode-select -p)?

9.4.1

@realm-probot realm-probot bot added the O:User label Oct 8, 2018

biboran added a commit to biboran/SwiftLint that referenced this issue Nov 9, 2018

biboran added a commit to biboran/SwiftLint that referenced this issue Nov 14, 2018

biboran added a commit to biboran/SwiftLint that referenced this issue Nov 14, 2018

biboran added a commit to biboran/SwiftLint that referenced this issue Nov 15, 2018

biboran added a commit to biboran/SwiftLint that referenced this issue Nov 15, 2018

biboran added a commit to biboran/SwiftLint that referenced this issue Nov 15, 2018

biboran added a commit to biboran/SwiftLint that referenced this issue Nov 15, 2018

biboran added a commit to biboran/SwiftLint that referenced this issue Nov 15, 2018

biboran added a commit to biboran/SwiftLint that referenced this issue Nov 15, 2018

jpsim added a commit to biboran/SwiftLint that referenced this issue Nov 28, 2018

realm#2435 - Adjust modifier_order rule to require explicit modifier …
…order specified to conclude a violation

jpsim added a commit to biboran/SwiftLint that referenced this issue Nov 28, 2018

jpsim added a commit to biboran/SwiftLint that referenced this issue Nov 28, 2018

jpsim added a commit to biboran/SwiftLint that referenced this issue Nov 28, 2018

jpsim added a commit that referenced this issue Nov 28, 2018

#2435 - Make modifier_order rule rely on an explicit set of rules (#2458
)

* #2435 - Adjust modifier_order rule to require explicit modifier order specified to conclude a violation

* #2435 - Move modifier order rule examples to a separate file

* #2435 - Add modifier interference tests

* #2435 - Fix whitespaces

* Minor edits

* Add changelog entry

@jpsim jpsim closed this Nov 28, 2018

@jpsim

This comment has been minimized.

Copy link
Collaborator

jpsim commented Nov 28, 2018

Resolved in #2458

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment