198 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
54
views
SwiftLint is ignoring excluded files in config when paths are passed to the command
I have some excluded files in my .swiftlint.yml file but when I pass in a list of files† to the swiftlint command (e.g. swiftlint lint <paths maybe including excluded files>), all the files get ...
Amja's user avatar
- 1,478
0
votes
0
answers
57
views
SwiftLintBuildToolPlugin doesn't have a bundle identifier
I integrated SwiftLint into my HelloWorld app to explore how I can incorporate it into my development and CI flow. While it works during development, I face a problem in my pipeline during archiving.
...
0
votes
0
answers
63
views
What is the scope of the sandbox when running build tool plugins in Xcode? How can I tell which SwiftLint file Xcode is reading?
I have a project in a multi-platform app that uses two local packages. I have the folders set up like so
Project/
.swiftformat
.swiftlint_strict.yml
.swiftlint.yml
Platforms/
iOS/
...
1
vote
0
answers
90
views
SwiftLint (SPM) Auto-correction for Trailing Whitespace Not Working Due to Sandbox Restrictions
I am using SwiftLint via Swift Package Manager (SPM) in my Xcode project and would like to enable automatic correction for removing whitespace in empty lines.
I have added the following configuration ...
0
votes
0
answers
79
views
How can i check SwiftLint working on commit and edited file
I'm using Github action to lint the swift language and using SwiftLint for that. I want SwiftLint to check only the committed and edited files in my project. I've tried multiple solutions, but none of ...
10
votes
0
answers
4k
views
identify and delete dead code in Xcode Swift
What is a .swiftlint or native approach employing a build phase script in Xcode to show a warning/error for unused functions and properties and to delete them?
I have some dead dummy code left over ...
0
votes
1
answer
367
views
SwiftLint Invalid configuration for 'file_length'. Falling back to default
I configured .swiftlint.yml and have the following error:
warning: Invalid configuration for 'line_length'. Falling back to default.
Here is my configuration:
...
line_length:
error: 120
excluded:...
0
votes
1
answer
494
views
Is there a way to change SwiftLint version in an Azure DevOps pipeline?
I'm attempting to use SwiftLint version 0.50.1 in my Azure DevOps pipeline to check iOS builds. Currently, the latest SwiftLint version is 0.53.0. However, I encountered some issues while trying to ...
0
votes
0
answers
84
views
Swiftlint Rule: Project Prefix on top-level types
Is there a way to add a rule in swiftlint that will enforce every top level class, enum, struct or protocol starting with a predetermined prefix?
In my case the prefix is PSO, so all my top type ...
0
votes
1
answer
1k
views
SwiftLint doesn't produce any warnings while code has a lot of of them
I've installed SwiftLint 0.53.0 into my pet project:
export PATH="$PATH:/opt/homebrew/bin"
if which swiftlint > /dev/null; then
swiftlint --fix
else
echo "Error! Swiftlint is ...
1
vote
0
answers
335
views
SwiftLint rule to prefer the use of implicit self where it can be used?
In SwiftLint there is a rule for explicit_self and a rule for redundant_self_in_closure.
But is there a rule would warn for overuse of self?
For instance in this example...
struct FooBar {
let ...
0
votes
1
answer
1k
views
Swiftlint allow force unwrap for hardcoded URLs while maintaining force_unwrapping rule
In my iOS porjects i use Swiftlint with the rule "force_unwrapping". But every time i need to hardcode a URL i'd like to simply force unwrap it.
Is there a configuration for Swiftlint to ...
0
votes
0
answers
159
views
SwiftLint native rule with custom path
How can I apply the native file_name SwiftLint rule specifically to test files (files ending with test or tests in their name)?
2
votes
0
answers
461
views
No Space in Method Call Violation: Don't add a space between the method name and the parentheses. (no_space_in_method_call)
I have many such warnings in the code:
"No Space in Method Call Violation: Don't add a space between the method name and the parentheses. (no_space_in_method_call)"
although there are no ...
1
vote
2
answers
102
views
Regex that doesn't contain is|has prefix but ends with : Bool
Sorry that I have to ask that, with all the other answers around, but I can't get my head around to think and adapt to my problem.
So I'm writing a custom SwiftLint rule that should check:
does not ...