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

Add configure command #5041

Draft
wants to merge 54 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
178371b
started to add Configure command
mildm8nnered May 27, 2023
f880162
More setup
mildm8nnered May 27, 2023
662c9f6
Better prompting
mildm8nnered May 27, 2023
65e5ffc
Kind of have bold working
mildm8nnered May 27, 2023
1e55cf1
colorization
mildm8nnered May 27, 2023
3ab75b0
Searching for more configurations
mildm8nnered May 27, 2023
34725dd
Directory scanning
mildm8nnered May 28, 2023
e40229d
refactor
mildm8nnered May 28, 2023
cb899e1
About to run
mildm8nnered May 28, 2023
d2ede50
Now running the linter
mildm8nnered May 28, 2023
f64f932
Now running SwiftLint
mildm8nnered May 28, 2023
9c2a41b
rule disablement
mildm8nnered May 28, 2023
6a4b49a
Implemented auto
mildm8nnered May 28, 2023
189be59
More tweaks
mildm8nnered May 29, 2023
1cf5e71
Tidyup
mildm8nnered May 29, 2023
d62083c
Tidyup
mildm8nnered May 29, 2023
ad7b319
We now write the temporary file to a temporary directory
mildm8nnered May 29, 2023
6434d8f
Added deprecated rule support
mildm8nnered May 29, 2023
26c2adb
Better writing
mildm8nnered May 29, 2023
b8ccd0c
Added start over support
mildm8nnered May 29, 2023
22df805
Added support for analyzer rules
mildm8nnered May 29, 2023
aede947
A few tweaks
mildm8nnered May 30, 2023
dbd903b
Support zero lintable files
mildm8nnered May 30, 2023
e118c4e
Linting fixes
mildm8nnered May 30, 2023
e39165a
Suppress deprecation warnings
mildm8nnered Jun 22, 2023
357cdec
Use the summary reporter identifier
mildm8nnered Jun 25, 2023
636cf7f
implemented allow zero lintable files
mildm8nnered Jun 25, 2023
aa1c63b
Better handling when no files are present
mildm8nnered Jun 25, 2023
5cb0176
Better messaging for deprecated rules
mildm8nnered Jun 25, 2023
74a4e82
Changed formatting slightly
mildm8nnered Jun 25, 2023
0a2c7b7
Fixed line length
mildm8nnered Jun 27, 2023
d54cf08
Do not start over any more
mildm8nnered Jul 2, 2023
e6a8254
Added reporter support
mildm8nnered Jul 3, 2023
9a871d2
Hacked around reporter identifiers
mildm8nnered Aug 30, 2023
1268868
Preserve configuration
mildm8nnered Oct 6, 2023
1354b69
Commented out deprecated rule handling for right now
mildm8nnered Oct 13, 2023
a264ef7
Restored deprecated rule handling
mildm8nnered Oct 13, 2023
3a58b41
Match our output and command line
mildm8nnered Oct 14, 2023
57391c7
swiftlint fixes
mildm8nnered Oct 14, 2023
2721107
Swiftlint fix
mildm8nnered Oct 14, 2023
d13c01c
tweaks
mildm8nnered Oct 14, 2023
b14fc3b
Swiftlint disable
mildm8nnered Oct 17, 2023
ba3926f
Added documentation for DeprecatedRule
mildm8nnered Nov 26, 2023
d542cc3
Autocorrects
mildm8nnered Mar 30, 2024
166f890
Hoisted by my own petard
mildm8nnered Apr 29, 2024
1fc5734
Fixed syntax error
mildm8nnered May 1, 2024
959fc8a
Account for working directory call
mildm8nnered Jun 29, 2024
6f2f9ae
Fixes
mildm8nnered Jul 15, 2024
cb4b573
Fixed arguments
mildm8nnered Aug 20, 2024
9227e9b
trailing whitespace
mildm8nnered Aug 23, 2024
0e72dda
Fixed accessibility
mildm8nnered Sep 29, 2024
e8fbff9
fixed up a stray description.identifier
mildm8nnered Oct 26, 2024
3e43c4b
Syntax fixes
mildm8nnered Oct 26, 2024
35efd4e
Fixed some issues/conflicts
mildm8nnered Dec 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Source/SwiftLintCore/Protocols/Rule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ public extension Rule {
/// A rule that is not enabled by default. Rules conforming to this need to be explicitly enabled by users.
public protocol OptInRule: Rule {}

/// A rule that has been deprecated, and that will be removed in a future release.
public protocol DeprecatedRule: Rule {}

/// A rule that can correct violations.
public protocol CorrectableRule: Rule {
/// Attempts to correct the violations to this rule in the specified file.
Expand Down
10 changes: 10 additions & 0 deletions Source/SwiftLintFramework/LintOrAnalyzeCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ package struct LintOrAnalyzeCommand {
}
}

package static func lintOrAnalyze(_ options: LintOrAnalyzeOptions) async throws -> [StyleViolation] {
let builder = LintOrAnalyzeResultBuilder(options)
_ = try await collectViolations(builder: builder)
let report = builder.reporter.generateReport(builder.violations)
if !report.isEmpty {
queuedPrint(report)
}
return builder.violations
}

private static func lintOrAnalyze(_ options: LintOrAnalyzeOptions) async throws {
let builder = LintOrAnalyzeResultBuilder(options)
let files = try await collectViolations(builder: builder)
Expand Down
Loading
Loading