-
Notifications
You must be signed in to change notification settings - Fork 366
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 SwiftLint and Swift Maker #2463
Open
jandamm
wants to merge
6
commits into
neomake:master
Choose a base branch
from
jandamm:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e391590
Swift: Add swiftlint Maker
jandamm 580a98f
Swift: Add swift (file) Maker
jandamm 1fc9dbb
Do not use l: prefix for local variables
jandamm 55e9321
Rename variable
jandamm 2bf8ae5
Improve swiftlint error matching
jandamm 2fcb9c3
Add swiftpm error without line or column
jandamm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Isn't there also such a thing as a global config?
I think it makes sense to not require a local config for linters to be enabled.
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.
SwiftLint officially does not support global configs. It does have a default configuration which I think many wouldn't want to be enabled for every file they open. E.g. it marks every variable shorter than two letters as an error.
The convention is having a config file in your project or provide it via an argument.
I think the best solution would be to search for a config file then run
swiftlint
, check for ~/.swiftlint.yml if it exists runswiftlintglobal
(with config provided).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.
But wouldn't people not liking swiftlint then just not install it?
I.e. if you have it it should be used - not only if you have some explicit config for it.
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.
I have it installed because some projects I work on use it, but others don't.
I cannot speak for everyone but I wouldn't want the default rules enabled and I'm not sure many are using a global config (there is a pretty old issue requesting this, though)
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.
I've had a look at swift.vim.
There swiftlint is also only enabled when a
.swiftlint.yml
is present or the user requests it.https://github.com/keith/swift.vim/blob/master/syntax_checkers/swift/swiftlint.vim#L14
What is your opinion? I would leave the current implementation as is. The user can always opt in and run/enable swiftlint for himself.