Commit Graph
234 Commits
Author SHA1 Message Date
Danny Mösch aa67f5ac13 Adopt typed throws where possible (#5922) 2025-09-27 19:11:46 +02:00
JP Simard 3a922d41f9 Add ConditionallySourceKitFree to migrate custom rules to SwiftSyntax (#6127)
The protocol will be used to tag rules that may or may not require
SourceKit depending on its configuration. I only expect this to be used
for custom rules as utility to help transition to a fully SwiftSyntax
based approach.
2025-06-21 15:54:56 -04:00
Martin Redington 5517d233fd Started to add rationales (#5681) 2025-03-06 10:16:30 +00:00
Danny Mösch 82736d1925 Add new opaque_over_existential rule (#5915) 2025-02-12 16:46:28 -05:00
Danny Mösch 364442ae6c Move --only-rule option to common arguments (#5981) 2025-02-12 14:27:10 -05:00
Danny Mösch 2cf298bf15 Remove exit helper workaround (#5900)
Introduced in 4fb5ebe19b due to
https://github.com/swiftlang/swift/issues/59961.
2024-12-19 12:57:18 -05:00
Danny Mösch 010cbd8bc5 Reduce target-specific imports (#5898) 2024-12-18 16:12:52 +01:00
Martin Redington 9ea4374145 Fix --only-rule config issues (#5773) 2024-10-25 17:19:17 +01:00
BlueVirusX e87efff39b Support Xcode input file lists (#5790)
Adds the option `--use-script-input-file-lists` and parsing for `.xcfilelist` files.
2024-10-25 06:57:41 -04:00
Danny Mösch 3b6ba6d1f0 Fix warning for unused return value in Linux build (#5819) 2024-10-07 19:55:57 +00:00
Danny Mösch ab699f98ae Use async/await for URL session (#5814) 2024-09-29 21:19:23 +02:00
Danny Mösch 246643fe55 Keep only command-line related functions in swiftlint module (#5806)
Swift 6 doesn't allow importing executable targets. So we need to
move testable logic into a framework.
2024-09-29 17:23:46 +02:00
Danny Mösch d28901e27e Remove deprecated option --in-process-sourcekit entirely (#5707) 2024-07-27 16:05:14 +00:00
Martin Redington 3421f5f46d Enable multiline_parameters rule, and fix all cases (#5664) 2024-07-18 01:48:02 +01:00
Martin Redington b1234e38a5 Add --only-rule command line option (#5666) 2024-07-15 23:52:52 +01:00
Danny Mösch cc4b569c54 Enable unused_parameter rule and fix all violations (#5673) 2024-07-14 11:20:50 -04:00
Martin Redington 21b7e5ed6b Enabled prefer_self_in_static_references, and fixed all current violations (#5662) 2024-07-10 18:58:27 +01:00
Martin Redington ed10aec5f8 Enable implicit_return and fix all violations (#5658) 2024-07-10 12:15:19 +01:00
Danny Mösch 714bf4c8c2 Document modified configurations used to lint examples (#5402) 2024-07-07 13:11:41 +02:00
Martin Redington e0b9295412 Add update checker (#5613) 2024-07-06 19:32:36 -04:00
Martin Redington 593bb625fb Adds --working-directory command line option (#5560) 2024-06-29 15:58:35 +01:00
Danny Mösch c810459e6a Enforce mandatory trailing comma and fix all violations (#5640) 2024-06-28 05:36:50 +00:00
Martin Redington 47ef99c802 Remove deprecated path argument (#5614) 2024-06-22 03:38:38 -04:00
Martin Redington 96db41c379 Add an experimental baseline feature (#5475) 2024-05-01 16:55:33 +02:00
Danny Mösch c32d5028cd Warn when --fix comes together with --strict or --lenient (#5493) 2024-03-11 20:14:10 +01:00
Danny Mösch 58928b7e40 Enforce any on existential types (#5273)
This makes syntactically clear which types are rather expensive.
2023-10-12 08:37:23 +02:00
JP SimardandDanny Mösch 406d4d270b Require Swift 5.9 (#5235)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2023-09-25 18:54:02 -04:00
Danny Mösch 8b2778e380 Add --config-only and --default-config options to rules command (#5199) 2023-09-02 05:41:23 -04:00
Danny Mösch 668cce84db Print YAML configuration in output of rules command 2023-08-28 20:19:28 +02:00
Danny Mösch a25fbe3e50 Make indent function a String extension 2023-07-17 23:18:26 +02:00
Danny Mösch 678cd6f805 Introduce a model for rule configuration description (#3931) 2023-07-03 22:47:30 +02:00
Danny Mösch 41b06629fd Add new --silence-deprecation-warnings flag (#5014) 2023-06-20 16:03:22 -04:00
Danny Mösch fe312a06fe Rely on pre-defined issues and allow to print them directly to the console (#5013)
Advantages of having typical errors at a common place:
* Error message styling can be harmonized
* Existing messages can be reused
* Overview of prefixes ('error: ', 'warning: ')
* Manage how to print them to the console
2023-05-16 20:15:14 +02:00
Danny Mösch 1fa8e484c4 Add expiring TODO comments on deprecation warnings 2023-05-10 21:44:20 +02:00
Chris White 71b89e66de Prepend warning: to error messages (#4927) 2023-05-01 18:26:25 +02:00
JP Simard 603fff9a82 Make Correction and CorrectableRule declarations public (#4937)
The CLI target shouldn't be importing SwiftLintFramework with
`@_spi(TestHelper)`. If the CLI target needs to access something in
SwiftLintFramework, that declaration should be `public`.
2023-04-26 12:17:10 -04:00
JP Simard 165172e0fa Introduce a "rule registry" concept
This will allow for registering rules that aren't compiled as part of
SwiftLintFramework.

Specifically this will allow us to split the built-in and extra rules
into separate modules, leading to faster incremental compilation when
working on rules since the rest of the framework won't need to be
rebuilt on every compilation.
2023-04-25 12:28:50 -04:00
Martin Redington 7dad240ea7 Add a reporters subcommand (#4836) 2023-03-31 08:09:01 +02:00
Danny Mösch aafc574e90 Allow to pass a rule identifier to the swiftlint docs command (#4710) 2023-02-07 00:01:52 +01:00
Danny Mösch 325d0ee1e4 Consider custom attributes in attributes rule (#4616) 2023-01-31 22:34:11 +01:00
Danny Mösch 5eed8fe91b Enable if_let_shadowing rule and fix all violations (#4247) 2023-01-31 22:31:38 +01:00
Ryan AveoandJP Simard 92304cdd98 Fix building tests in Xcode (#4607)
Co-authored-by: JP Simard <jp@jpsim.com>
2022-11-30 10:33:33 -05:00
JP Simard ba8899714d Reduce visibility of custom rules (#4553) 2022-11-16 16:14:50 -05:00
JP Simard 0f9705901b Add column for SourceKit usage to rules command (#4284) 2022-10-04 18:52:03 +00:00
Vasiliy Kattouf 129a55fb74 Add ability to filter rules for generate-docs subcommand (#4195)
Added rules filtering options, like in the `rules` subcommand.

<img width="880" alt="generate-docs--help" src="https://user-images.githubusercontent.com/7829589/189372666-2f5aba62-57a1-49dc-9155-c60f9e085984.png">

To achieve reuse with `rules` subcommand:
- extracted filtering logic into `RulesFilter` (and write tests)
- extracted filtering command line parameters into `RulesFilterOptions: ParsableArguments`
2022-10-04 18:45:52 +00:00
JP Simard 4fb5ebe19b Docker: Update to Swift 5.7 & Ubuntu Jammy (#4241)
And apply workaround for https://github.com/apple/swift/issues/59961 to
all commands.
2022-09-24 15:09:41 -04:00
JP Simard e0f23fa8e9 Add --progress flag to lint and analyze commands (#4147)
Inspired by https://github.com/jkandzi/Progress.swift

```
4948 of 29100 [=====                         ] ETA: 44s (540 files/s)
```

Demo:

[![asciicast](https://asciinema.org/a/517985.svg)](https://asciinema.org/a/517985)
2022-08-31 18:26:17 -04:00
JP Simard 4bc6588f38 Add --output option to lint and analyze commands (#4148)
To write to a file instead of to stdout.

Addresses https://github.com/realm/SwiftLint/issues/4048
2022-08-31 17:34:37 -04:00
JP Simard 73c88c3af0 Add version --verbose command (#4102)
Prints out something like this on macOS:

```
Version: 0.49.0-rc.1
Build ID: B43931F3-D096-3704-B41C-FC40673A3F96
```

This can be used to determine if two `swiftlint` executables are
identical.
2022-08-16 14:12:44 +00:00
JP Simard a97718f4c6 Replace incrementer dispatch queue with an actor (#4073)
To support this, we first must use an async entrypoint to the CLI, which
we do by changing the lint and analyze commands to conform to
`AsyncParsableCommand`.

The in order to map over the closures with suspension points, we pull in
CollectionConcurrencyKit as a new dependency.

This change does not touch SwiftLintFramework, only the CLI target.
2022-08-09 13:06:08 +00:00