Skip to content
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
2 tasks done
abdulowork opened this issue Oct 8, 2018 · 1 comment
Closed
2 tasks done

Comments

@abdulowork
Copy link
Contributor

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
abdulowork added a commit to abdulowork/SwiftLint that referenced this issue Nov 9, 2018
abdulowork added a commit to abdulowork/SwiftLint that referenced this issue Nov 14, 2018
abdulowork added a commit to abdulowork/SwiftLint that referenced this issue Nov 14, 2018
abdulowork added a commit to abdulowork/SwiftLint that referenced this issue Nov 15, 2018
abdulowork added a commit to abdulowork/SwiftLint that referenced this issue Nov 15, 2018
abdulowork added a commit to abdulowork/SwiftLint that referenced this issue Nov 15, 2018
abdulowork added a commit to abdulowork/SwiftLint that referenced this issue Nov 15, 2018
abdulowork added a commit to abdulowork/SwiftLint that referenced this issue Nov 15, 2018
abdulowork added a commit to abdulowork/SwiftLint that referenced this issue Nov 15, 2018
jpsim pushed a commit to abdulowork/SwiftLint that referenced this issue Nov 28, 2018
jpsim pushed a commit to abdulowork/SwiftLint that referenced this issue Nov 28, 2018
jpsim pushed a commit to abdulowork/SwiftLint that referenced this issue Nov 28, 2018
jpsim pushed a commit to abdulowork/SwiftLint that referenced this issue Nov 28, 2018
jpsim pushed a commit that referenced this issue Nov 28, 2018
)

* #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 as completed Nov 28, 2018
@jpsim
Copy link
Collaborator

jpsim commented Nov 28, 2018

Resolved in #2458

sjavora pushed a commit to sjavora/SwiftLint that referenced this issue Mar 9, 2019
realm#2458)

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

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

* realm#2435 - Add modifier interference tests

* realm#2435 - Fix whitespaces

* Minor edits

* Add changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants