-
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
Add update checker #5613
Add update checker #5613
Conversation
5017b0f
to
735f371
Compare
Generated by 🚫 Danger |
6899365
to
a86b335
Compare
79c9df6
to
ddeab5d
Compare
8a4e922
to
cee4b3e
Compare
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.
Looks good to me! A CHANGELOG entry is all that's left.
It comes with async URLSession from FoundationNetworking.
changelog entry added, but it looks like we're failing CI on the server on the Linux build and Danger as well maybe. |
Seems like this is only going to work in Swift 6 (with libraries updated accordingly). So we can revert my changes and go with the classic implementation for now until we switch to Swift 6. |
Finally worked this out - the new protocol unsurprisingly needed to be public (and documented). |
Adds an update check facility to SwiftLint - addresses #5551
This has been added as a
--check-for-updates
command line option to theversion
,lint
, andanalyze
commands.It can also be enabled via the configuration file, as
check_for_updates
.Although the usefulness of an opt-in option is limited, at least this provides a good story for how users can keep their installs up to date. And it could easily be changed to opt-out either here or at some later date.
The update checker code is pretty closely based on Periphery's implementation, and should probably be credited in the source file.
The update check is performed after all other processing, so linting will never be delayed, and the code is completely synchronous, as we do not have to worry about blocking the main thread.
The messaging for a new version is:
A new version of SwiftLint is available: 0.51.1
We currently do not print any messaging if the update check fails, which is probably wrong.