Commit Graph

189 Commits

Author SHA1 Message Date
JP Simard e381a7d684
Update bazel version in readme 2022-09-02 10:10:09 -04:00
JP Simard ea41b9fd09
Rename default branch from `master` to `main` (#4116) 2022-09-01 07:09:46 -04:00
JP Simard 0e3f3de17f
Set CHANGELOG header back to 'Master'
And update bazel ref in readme to point to `0.49.0-rc.2`.
2022-08-18 16:35:21 -04:00
JP Simard 35df4ba6a1
Update bazel ref in readme 2022-08-12 11:07:05 -04:00
JP Simard 340fce43c8
Update bazel ref in readme (#4052) 2022-07-28 13:19:19 -04:00
JP Simard ffc6379828
Fix rendering issue in readme
GitHub doesn't render this as a code block, it renders the backticks.
2022-07-26 09:56:13 -04:00
JP Simard 24735ef4d3
Add support for building with Bazel (#4038) 2022-07-26 07:09:02 -04:00
JP Simard 05ac3c9d75
Require macOS 12 & Swift 5.6 (#4037)
This will unblock using Swift Concurrency features and updating to the
latest versions of Swift Argument Parser.

This won't drop support for linting projects with an older toolchain /
Xcode selected, as long as SwiftLint was _built_ with 5.6+ and is
_running_ on macOS 12+. So the main breaking change for end users here
is requiring macOS 12 to run.

However, the upside to using Swift Concurrency features is worth the
breaking change in my opinion. Also being able to stay on recent Swift
Argument Parser releases.
2022-07-26 03:55:36 -04:00
Ruby 37f95d996e
fix typo in README (#4016) 2022-07-06 15:32:09 +02:00
Marcelo Fabri a19ffddf66
Support arrays for `included` & `excluded` in custom rules (#4006)
* Support arrays for `included` & `excluded` in custom rules

* Extract shouldValidate(filePath:) and add tests
2022-06-27 00:29:26 -07:00
Marcelo Fabri 71db511003
Remove Alcatraz from README
This hasn't been properly supported for years. Fixes https://github.com/realm/SwiftLint/issues/3782
2022-06-15 10:18:54 -07:00
Liam 64f656cb46
Update README.md (#3995) 2022-06-14 21:17:07 +02:00
Danny Mösch bc7917be04
Use explicit link command (#3966) 2022-05-01 12:32:14 -04:00
Danny Moesch 12cda68ce2
Fix some typos and improve wording/style (#3910) 2022-03-18 17:42:25 -04:00
JP Simard 87d21e44e6
Edit wording in build phase Homebrew instructions 2022-03-17 13:31:04 -04:00
Michael Henry a129163053
Update applesilicon x brew fix Instruction (#3903) 2022-03-17 13:22:09 -04:00
JP Simard eeba297f33
[Docs] Remove "experimental" label for analyzer rules (#3884)
These have been fairly stable for over two years at this point.
2022-03-09 14:45:09 -05:00
JP Simard be1f8596e4
Require Swift 5.5 to build SwiftLint (#3869)
* Disable Swift 5.4 CI jobs
* Remove SwiftLintFramework podspec
  I couldn't find a single use in GitHub's search: https://github.com/search?q=SwiftLintFramework+filename%3APodfile+language%3ARuby+language%3ARuby&type=Code
  Just not worth maintaining anymore.
* Change package swift tools version to 5.5
* Update docker_test to use Swift 5.5 image
* Clean up old Swift versions in SwiftVersionTests
  Even though these older Swift versions should still be supported, these tests
  can't be built against those versions so they're useless.
* Run docker commands with `--platform linux/amd64`
* Remove LinuxMain
  It looks like tests are discovered dynamically on Linux as of recent
  SwiftPM versions.
2022-03-07 12:15:03 -05:00
JP Simard 068f6037fe
[CI] Move back to Azure Pipelines (#3826)
Yesterday I started moving SwiftLint's CI jobs from Azure Pipelines to
GitHub Actions, which has nicer integrations with GitHub's web UI and
feels nicer & more lightweight overall.

However, GitHub Actions has a serious limitation compared to Azure
Pipelines, which is that it only has 5x macOS job concurrency vs Azure's
10x ([see Twitter](https://twitter.com/simjp/status/1326592600393068546)).
This leads to significant queuing when merging PRs or pushing to PRs in
a short span, which is the main way I work on SwiftLint when catching up
on PR/issue backlog every few months.

A quick timing check showed that a PR using Azure Pipelines (#3825) took
26m 47s vs GitHub Actions (#3824) took 32m 31s. These PRs were opened at
a time when no other CI jobs were running, so even though Azure
Pipelines already took 6 minutes less to run than GitHub Actions, that
difference would be even larger if there had been other PRs triggering
CI jobs at the same time.

So I think the best move for the project for the time being is to stay
with Azure Pipelines for its CI. If GitHub ever increases its macOS
concurrency to match Azure Pipelines's 10x we can explore this again.
2022-01-25 13:56:58 -08:00
JP Simard c5ea00c2d7
Fix CI badges 2022-01-24 23:41:58 -05:00
JP Simard 4525e9999b
Move remaining CI jobs to GitHub Actions (#3822)
Analyze, TSan, Xcode & Docs
2022-01-24 20:29:33 -08:00
JP Simard 73e6cef0c2
Add changelog entry for Docker 2022-01-21 15:52:31 -05:00
Francisco Javier Trujillo Mata c52d4cde8d
Add usage of Docker into the Readme (#3808) 2022-01-21 08:28:19 -08:00
Sam Soffes 09d912ca37
Update README.md (#3778)
Since Homebrew installs to a path that isn't in Xcode's path by default, we need to add to the path to support the default location Homebrew installs SwiftLint on Apple Silicon.

From https://stackoverflow.com/a/66003612/118631
2022-01-21 07:02:14 -08:00
Ezequiel França 2408839be3
Updating Readme to replace autocorrect by fix (#3779) 2021-12-16 14:08:29 +00:00
Hannes Ljungberg ed79195cf5
Add support for pre-commit (#3714) 2021-11-29 11:09:43 -08:00
Bas Broek 119f9d7f91
Expand README url (#3755)
From https://realm.github.io/SwiftLint/index.html, this would route to `https://realm.github.io/SwiftLint/Source/SwiftLintFramework/Rules`, which does not exist. Explicitly link to GitHub.
2021-11-29 09:21:50 -08:00
JP Simard 888619912f
Run CI with Xcode 12.5.1 & Swift 5.4 (#3710)
And require Swift 5.4 or Xcode 12.5 or later to build SwiftLint.
2021-09-10 08:32:02 -07:00
Gonzalo RH 9c9e3f54ab
Updated README to mach swift-argument-parser's array parsing strategy. (#3698) 2021-09-09 14:15:21 -07:00
Wolfgang Lutz 7420248c0f
Make Analyzer instructions more clear (#3708)
Instructions originally posted by @timothycosta in https://github.com/realm/SwiftLint/issues/3634#issuecomment-845611219
2021-09-09 12:42:20 -04:00
Adam Wolf 83e1bee22b
Fix misleading env variable example in README (#3664) 2021-08-16 02:17:30 -07:00
Roger Oba 242151776f
Update number of rules. (#3630) 2021-05-13 10:48:53 -07:00
Valentin Knabel ebb51ed6f7
Add vscode extension to README.md (#3568) 2021-05-02 16:12:15 -04:00
JP Simard 058869f446
Require Swift 5.3 or higher to build (#3553)
* Require Swift 5.3 or higher to build

* Remove Swift Version Support tables from readmes

These weren't exactly accurate because SwiftLint should still work with
older Swift versions long after we update the minimum version of Swift
needed to _build_ the tool. So I doubt this table was very helpful to
anyone.
2021-03-04 18:07:04 +00:00
Christian Mitteldorf 4e75099e16
Link to Ray Wenderlich’s Swift Style guide (#3250)
GitHub has archived their current style guide.
The style guide from Wenderlich closely follows the existing rules, and is still being maintained.
2021-02-23 12:07:07 -08:00
Frederick Pietschmann 4c5a3f0577 Add remote, parent & child configuration features 2020-11-20 23:08:37 +01:00
Jan-Otto Kröpke 874cacbd1f
Add codeclimate reporter (#3425) 2020-11-11 10:29:00 -08:00
JP Simard 76708d88f7
Remove Xcode project & Drop Carthage Support
Xcode has supported Swift Package Manager projects natively since Xcode
11, which has been out for over a year, where you can use Xcode by
having it open the `Package.swift` manifest rather than a `.xcodeproj`
or `.xcworkspace`.

I've been primarily developing SwiftLint in Xcode using this approach
for over a year, and despite a few nitpicks I have, it's been a joy to
use.

So I'd like to completely remove the Xcode project along with things
that support it:

* `SwiftLint.xcworkspace`/`SwiftLint.xcodeproj`: Neither of these are
  needed if we use `xed .` or `xed Package.swift` to develop SwiftLint
  in Xcode.
* `Cartfile`/`Cartfile.private`/`Cartfile.resolved`/`.gitmodules`/`Carthage/`:
  These were used to manage dependencies as git submodules for use in
  the Xcode workspace, but that's no longer necessary if Xcode delegates
  to SwiftPM to manage dependencies for us.
* Some scripts can be simplified, cleaned up or even completely removed.

* **Reduce duplication:** Rather than update dependencies or files in
  multiples places, there will only be the package manifest and the
  Podfile
* **Reduce merge conflicts:** This hasn't been too bad, but it's
  occasionally a pain when trying to land old PRs
* **Reduce development overhead:** No need to manually make sure that
  files in the Xcode project are sorted alphabetically
* **Reduce clone time:** No need to run
  `git submodules update --init --recursive` anymore

I think this breaks Carthage users that pull in SwiftLintFramework as a
dependency in a Cartfile.

However I can't find any references to [`SwiftLintFramework` in any
`Cartfile` files on GitHub](https://github.com/search?q=swiftlintframework+filename%3ACartfile&type=Code&ref=advsearch&l=&l=)
so this doesn't appear to be worth continuing to maintain.

Resolves https://github.com/realm/SwiftLint/issues/3412
2020-11-08 13:32:07 -05:00
Christian Mitteldorf 67165f7c64
Improve documentation for running SwiftLint as Xcode build phase 2020-11-08 09:11:02 -05:00
Dalton Claybrook d305e03905
Add `inclusive_language` rule (#3243)
Current events have renewed the conversation in our community about the roles of terminology with racist connotations in our software. Many companies and developers are now taking appropriate steps to remove this terminology from their codebases and products. (e.g. [GitHub](https://twitter.com/natfriedman/status/1271253144442253312)) This small rule prevents the use of declarations that contain any of the terms: whitelist, blacklist, master, and slave. It may be appropriate to add more terms to this list now or in the future.
2020-11-07 22:03:08 -05:00
Iulian Onofrei bed8591e65
Fix incorrect regex patterns in README files (#3393) 2020-11-07 20:08:27 -05:00
Marcelo Fabri 20b86147d9
Merge pull request #3236 from realm/cg_improve-whitelist-docs
Improve visibility of whitelist_rules option
2020-08-04 03:53:07 -07:00
Cihat Gündüz 11b13da9ad Improve visibility of whitelist_rules option
Related to https://github.com/realm/SwiftLint/issues/1451 and https://github.com/realm/SwiftLint/issues/1118
2020-06-11 17:24:14 +02:00
Liam Nichols d1b1393748
Update README files to include complete list of reporters 2020-06-05 14:06:46 +01:00
JP Simard b744cf08f1
Temporarily remove all SwiftSyntax rules and support (#3107)
The new rules introduced in 0.39.0 that depend on SwiftSyntax have been temporarily removed as we work out release packaging issues.

* `prohibited_nan_comparison`
* `return_value_from_void_function`
* `tuple_pattern`
* `void_function_in_ternary`

See https://github.com/realm/SwiftLint/issues/3105 for details.
2020-02-11 13:40:04 -08:00
Marcelo Fabri 8d9c501cb8
Add optional return_value_from_void_function rule using SwiftSyntax (#3054)
* Add optional return_value_from_void_function rule using SwiftSyntax

* Use Script/bootstrap in CI

* Make SwiftSyntax optional

* Make SwiftSyntax optional in SPM

* Fix Package.swift

* Try again

* Add minSwiftVersion

* Fix thread sanitizer issue

* Take 2

* Fix false positive on nested computed variables

* Remove support for Xcode 10.x

* Fix rule description

* Enable opt-in rule in configuration file

* Extract code into `SyntaxRule` protocol

* nit: make property private

* Missing docs

* Fix MasterRuleList.swift

* Update CHANGELOG

* Remove unused imports

* Use Example type

* Change rule kind to .idiomatic

* Update CHANGELOG

* Bump deployment target to macOS 10.12

* Simplify SyntaxRule.validate(file:visitor)

* Make TSan happy

* Use script/bootstrap in the README
2020-02-08 02:43:40 -08:00
JP Simard d2643db495
[Docs] Build docs using jazzy (#3016)
* Add `.jazzy.yaml` configuration file
* Update `swiftlint generate-docs` to write docs to a directory rather than a single file
* Add jazzy to the Gemfile
* Run `bundle update`
* Add CI job to run jazzy automatically and publish to GitHub Pages

![swiftlint-jazzy](https://user-images.githubusercontent.com/474794/71799038-fcf4e180-3008-11ea-81fa-3eb9cf296506.gif)
2020-01-07 20:31:29 -08:00
Pyry Jahkola 805b9ab3ba
Add capture_group option to custom_rules
This option allows for more fine-grained placement of the location
marker for code violating a custom rule, e.g.:

```swift
print("Hello world.")
             ^~~~~
```

for this `.swiftlint.yml`:

```yaml
custom_rules:
  world_preceded_by_hello:
    name: "World Preceded by Hello"
    included: ".+\\.swift"
    message: "The word World predeced by the word hello should be capitalised."
    severity: warning
    regex: "(?i:hello)\\s+(world)"
    match_kinds: [string]
    capture_group: 1
```
2020-01-05 15:24:11 -08:00
Sven Münnich 63b5b92e59 Update documentation regarding `exclude` definition in nested `.swiftlint.yml` (#2731) 2019-11-07 14:22:36 -08:00
JP Simard 24208ddbd5
Run Danger and OSSCheck on MacStadium instead of on Azure Pipelines (#2941)
This will allow us to run OSSCheck on a bare metal Mac, which should
make the OSSCheck performance results more reliable than running on
virtual machines from Azure Pipelines.
2019-11-05 14:55:22 -08:00