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

Improved identifier_name documentation #4784

Conversation

mildm8nnered
Copy link
Collaborator

Resolves #4767

I added a few more examples, and removed the reference to immutable in the documentation.

It still does seem a bit weird that

static let Bar = 0 (outside a class) will trigger the identifier_name rule, but that

class Foo {
    static let Bar = 0
}

Does not.

@SwiftLintBot
Copy link

SwiftLintBot commented Feb 25, 2023

18 Messages
📖 Linting Aerial with this PR took 1.05s vs 1.05s on main (0% slower)
📖 Linting Alamofire with this PR took 1.36s vs 1.35s on main (0% slower)
📖 Linting Brave with this PR took 7.32s vs 7.35s on main (0% faster)
📖 Linting DuckDuckGo with this PR took 3.06s vs 3.05s on main (0% slower)
📖 Linting Firefox with this PR took 9.23s vs 9.24s on main (0% faster)
📖 Linting Kickstarter with this PR took 10.24s vs 10.27s on main (0% faster)
📖 Linting Moya with this PR took 0.53s vs 0.53s on main (0% slower)
📖 Linting NetNewsWire with this PR took 3.04s vs 3.04s on main (0% slower)
📖 Linting Nimble with this PR took 0.61s vs 0.59s on main (3% slower)
📖 Linting PocketCasts with this PR took 7.17s vs 7.16s on main (0% slower)
📖 Linting Quick with this PR took 0.23s vs 0.23s on main (0% slower)
📖 Linting Realm with this PR took 11.5s vs 11.55s on main (0% faster)
📖 Linting SourceKitten with this PR took 0.43s vs 0.44s on main (2% faster)
📖 Linting Sourcery with this PR took 2.2s vs 2.2s on main (0% slower)
📖 Linting Swift with this PR took 4.52s vs 4.52s on main (0% slower)
📖 Linting VLC with this PR took 1.35s vs 1.35s on main (0% slower)
📖 Linting Wire with this PR took 8.34s vs 8.36s on main (0% faster)
📖 Linting WordPress with this PR took 11.09s vs 11.07s on main (0% slower)

Generated by 🚫 Danger

@mildm8nnered mildm8nnered marked this pull request as ready for review February 25, 2023 18:11
@SimplyDanny
Copy link
Collaborator

It still does seem a bit weird that static let Bar = 0 (outside a class) will trigger the identifier_name rule, ...

What do you mean by that? Static variables cannot be declared outside of a type.

@SimplyDanny
Copy link
Collaborator

Thank you for the fix!

@SimplyDanny SimplyDanny merged commit 0479192 into realm:main Feb 25, 2023
@mildm8nnered
Copy link
Collaborator Author

It still does seem a bit weird that static let Bar = 0 (outside a class) will trigger the identifier_name rule, ...

What do you mean by that? Static variables cannot be declared outside of a type.

In actual swift code, yep, but if you provide it as an Example, but not wrapped in a class, it shows up as a .varGlobal instead of a .varStatic. I guess this is related to the fact that many of the examples are not actually valid swift code, by themselves (e.g. see #3348).

@mildm8nnered mildm8nnered deleted the mildm8nnered-identifier-name-static-variables branch April 17, 2023 23:30
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

Successfully merging this pull request may close these issues.

identifier_name issue didn't show warning
3 participants