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

Compile with -strict-concurrency=complete #5320

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

jpsim
Copy link
Collaborator

@jpsim jpsim commented Nov 1, 2023

Only in Bazel for now, because this is considered an unsafe flag in SwiftPM which would lead to warnings for downstream consumers of SwiftLint using SwiftPM.

Some imports of SwiftSyntax need the @preconcurrency annotation until swiftlang/swift-syntax#2322 is available in a release.

The following SwiftLint libraries have -strict-concurrency=complete applied:

  • SwiftLintCoreMacros
  • SwiftLintBuiltInRules (CI only)
  • SwiftLintExtraRules

The following SwiftLint libraries don't have the flag applied and need to be migrated:

  • SwiftLintCore
  • swiftlint (CLI target)

So really the rules and macros are now being compiled with -strict-concurrency=complete, but the core infrastructure of SwiftLint is not.

Still, given that Swift 6 will eventually make these warnings errors by default, it's good to prevent issues from creeping in earlier rather than later.

Only in Bazel for now, because this is considered an unsafe flag in
SwiftPM which would lead to warnings for downstream consumers of
SwiftLint using SwiftPM.

Some imports of SwiftSyntax need the `@preconcurrency` annotation until
swiftlang/swift-syntax#2322 is available in a
release.

The following SwiftLint libraries have `-strict-concurrency=complete`
applied:

* SwiftLintCoreMacros
* SwiftLintBuiltInRules
* SwiftLintExtraRules

The following SwiftLint libraries don't have the flag applied and need
to be migrated:

* SwiftLintCore
* swiftlint (CLI target)

So really the rules and macros are now being compiled with
`-strict-concurrency=complete`, but the core infrastructure of SwiftLint
is not.

Still, given that Swift 6 will eventually make these warnings errors by
default, it's good to prevent issues from creeping in earlier rather
than later.
@jpsim
Copy link
Collaborator Author

jpsim commented Nov 1, 2023

Sadly this leads to warnings diagnostics in SwiftPM since it doesn't have the flag:

remark: '@preconcurrency' attribute on module 'SwiftSyntax' is unused

So might not want to enable that. 🤔

@SwiftLintBot
Copy link

SwiftLintBot commented Nov 1, 2023

3 Warnings
⚠️ If this is a user-facing change, please include a CHANGELOG entry to credit yourself!
You can find it at CHANGELOG.md.
⚠️ This PR may need tests.
⚠️ This PR introduced a violation in Swift: /validation-test/IDE/crashers_fixed/issue-57321.swift:8:32: warning: Unused Closure Parameter Violation: Unused parameter in a closure should be replaced with _ (unused_closure_parameter)
17 Messages
📖 Linting Aerial with this PR took 0.21s vs 0.21s on main (0% slower)
📖 Linting Alamofire with this PR took 0.24s vs 0.22s on main (9% slower)
📖 Linting Brave with this PR took 1.07s vs 1.07s on main (0% slower)
📖 Linting DuckDuckGo with this PR took 0.57s vs 0.57s on main (0% slower)
📖 Linting Firefox with this PR took 1.02s vs 1.02s on main (0% slower)
📖 Linting Kickstarter with this PR took 1.98s vs 1.98s on main (0% slower)
📖 Linting Moya with this PR took 0.17s vs 0.17s on main (0% slower)
📖 Linting NetNewsWire with this PR took 0.43s vs 0.43s on main (0% slower)
📖 Linting Nimble with this PR took 0.16s vs 0.16s on main (0% slower)
📖 Linting PocketCasts with this PR took 1.57s vs 1.57s on main (0% slower)
📖 Linting Quick with this PR took 0.11s vs 0.11s on main (0% slower)
📖 Linting Realm with this PR took 0.74s vs 0.74s on main (0% slower)
📖 Linting Sourcery with this PR took 0.37s vs 0.38s on main (2% faster)
📖 Linting Swift with this PR took 1.23s vs 1.2s on main (2% slower)
📖 Linting VLC with this PR took 0.24s vs 0.25s on main (4% faster)
📖 Linting Wire with this PR took 2.22s vs 2.2s on main (0% slower)
📖 Linting WordPress with this PR took 1.58s vs 1.6s on main (1% faster)

Here's an example of your CHANGELOG entry:

* Compile with `-strict-concurrency=complete`.  
  [jpsim](https://github.com/jpsim)
  [#issue_number](https://github.com/realm/SwiftLint/issues/issue_number)

note: There are two invisible spaces after the entry's text.

Generated by 🚫 Danger

@jpsim jpsim enabled auto-merge (squash) November 1, 2023 15:16
@jpsim jpsim merged commit 3eb3772 into main Nov 1, 2023
@jpsim jpsim deleted the compile-with-strict-concurrency-complete branch November 1, 2023 15:20
SimplyDanny added a commit to SimplyDanny/SwiftLint that referenced this pull request Feb 6, 2024
See realm#5320 for the reasons behind this.
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.

2 participants