Commit Graph

60 Commits

Author SHA1 Message Date
JP Simard 8c617d7412
[CI] Update Azure Pipelines to run with Swift 5.8 (#4890)
Linux only because Azure Pipelines doesn't have any
images with macOS 13 or Xcode 14.3 yet.
2023-04-14 14:27:03 +00:00
JP Simard 1b0f37c6f6
Pin Sourcery version to 2.0.2 (#4888)
By adding a `tools/sourcery` script that downloads and runs Sourcery via
Bazel.

Previously, unrelated changes might include modifications to the
generated comment headers because contributors' local versions of
Sourcery would be used, which we don't control.

Also move the CI job to Buildkite where the bazel server is usually
already warmed up and running.
2023-04-13 20:09:26 +00:00
Gabriel Féron 409f117da9
Use Ubuntu 20.04 to release Linux binaries (#4882)
* Use Ubuntu 20.04 to release Linux binaries

Using the latest version of Ubuntu leads to incompatibilities with `glibc` versions from LTS versions.

* Use Ubuntu 20.04 for Azure pipelines
2023-04-13 13:25:43 -04:00
JP Simard e9c1128b86
Move SwiftPM CI job to Buildkite (#4589)
We have 6 CI machines now and these should run faster on bare metal
machines with lots of stuff already cached, like starting with an
existing git repo.
2022-11-24 17:58:09 +00:00
JP Simard b4f45aa55e
Move TSan Runs CI job to Buildkite (#4457)
Now that we have more Buildkite machines, these should be faster than
running on Azure Pipelines.

Also remove the `//bazel:xcode_config` configurations since they should
no longer be in use.
2022-10-23 13:05:28 -04:00
JP Simard 4b04e528af
Revert "Run TSan job on Azure Pipelines with Bazel (#4130)" (#4350)
This reverts commit 848ec452c3.

This appears to be slower most of the time.
2022-10-12 14:26:45 +00:00
JP Simard 6d75645f67
[CI] Disable xcodebuild tests (#4287)
This is failing very often now due to FB11648454.

Given that we run these tests on macOS via SwiftPM and Bazel as well,
I'm satisfied with the amount of coverage we have on our tests without
this.
2022-10-05 15:26:14 -04: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 fd7afedfcf
Update SwiftSyntax & internal parser for Swift 5.7 (#4203)
Require Swift 5.7 to compile
2022-09-26 14:11:39 +00:00
JP Simard ea41b9fd09
Rename default branch from `master` to `main` (#4116) 2022-09-01 07:09:46 -04:00
JP Simard fc3b143973
Rename `script` directory to `tools` (#4141)
And move the Danger bazel config there
2022-08-29 01:16:20 -04:00
JP Simard ea6ca3e8dd
[CI] Use `ci.bazelrc` in Azure Pipelines 2022-08-28 23:00:17 -04:00
JP Simard 7412205b6c
[CI] Use Xcode 13.4.1 on Azure Pipelines (#4134) 2022-08-28 14:42:57 -04:00
JP Simard 8dbc0e4cbf
Update Azure Pipelines to use 'ubuntu-latest' for Linux jobs 2022-08-28 14:20:11 -04:00
JP Simard 848ec452c3
Run TSan job on Azure Pipelines with Bazel (#4130) 2022-08-28 10:51:58 -04:00
JP Simard 2960ae6a7a
Test with thread sanitizer in Buildkite using Bazel (#4115)
This will allow for the test to be skipped if it's already cached,
speeding up CI runs.
2022-08-22 19:21:54 -04:00
Danny Mösch 9eb6dd016c
Let Sourcery always run independent of changed files (#4084) 2022-08-11 16:28:17 +00:00
Danny Mösch 68d88ded61
Check in build that Sourcery generated files are up-to-date (#4035) 2022-07-26 20:50:05 +02: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
JP Simard 3a4afce623
[CI] Update to Xcode 13.3.1 (#3961)
* [CI] Update to Xcode 13.3.1

* Update jazzy
2022-04-27 11:31:01 -04:00
JP Simard cb5fa0425d
Move Analyze CI job to Buildkite (#3919)
We now have two Buildkite agents thanks to a newly added M1 Mac mini
from MacStadium. Running the analyze job should be considerably faster
than the VMs that run on Azure Pipelines, although still slower than
if we were to run them with Xcode 13.2.1 because of the performance
regressions described in https://github.com/realm/SwiftLint/issues/3920.
2022-04-05 12:05:38 -04:00
Paul Taykalo 1616023b63
Add ability to run only one(focused) example (#3911)
* Add ability to focus on a specific test example

* Update CHANGELOG.md

Co-authored-by: JP Simard <jp@jpsim.com>

* Update CONTRIBUTING.md

Co-authored-by: JP Simard <jp@jpsim.com>

Co-authored-by: JP Simard <jp@jpsim.com>
2022-03-22 19:21:25 +02:00
JP Simard de3569cb3b
Update SwiftSyntax to 0.50600.0 (#3901)
Uses SwiftSyntax 5.5 on Linux when building with Swift 5.5. We use the 5.6 version of
SwiftSyntax when building with Swift 5.5 and 5.6 on macOS because we statically link
`lib_InternalSwiftSyntaxParser` thanks to
https://github.com/keith/StaticInternalSwiftSyntaxParser/releases/tag/5.6.

This keeps SwiftLint binaries portable across machines on macOS, regardless of
_where_ or even _if_ `lib_InternalSwiftSyntaxParser` is installed.

* Run TSan CI job with `--configuration release` to avoid stack overflows
* Add Swift 5.6 CI job
* Fix linker settings
2022-03-17 13:19:48 -04: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 b107180cf5
[CI] Fix codecov integration (#3828)
This has been broken since we removed the Xcode project in #3414 over a
year ago.
2022-01-25 15:13:14 -08:00
JP Simard d65a708f29
Add Swift 5.5 / Xcode 13.2.1 CI jobs (#3827)
And lint the SwiftLint podspec in addition to the SwiftLintFramework one
2022-01-25 14:33:59 -08: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 4525e9999b
Move remaining CI jobs to GitHub Actions (#3822)
Analyze, TSan, Xcode & Docs
2022-01-24 20:29:33 -08:00
JP Simard 83560fffa7
Move SwiftLint Analyze CI job to GitHub Actions (#3820) 2022-01-24 16:25:39 -08:00
JP Simard 0c731e72da
Bump Xcode version used by jazzy CI job (#3821) 2022-01-24 16:00:22 -08:00
JP Simard 2bd54cf3ce
Move CocoaPods CI jobs to GitHub Actions (#3819) 2022-01-24 15:24:42 -08:00
JP Simard 4c3bb24a04
Move SwiftPM CI jobs to GitHub Actions (#3818) 2022-01-24 14:59:14 -08:00
Paul Taykalo 13e1bf709d
Update linux version on CI to Ubuntu 18.04 (#3742) 2021-10-15 08:40:40 -07:00
JP Simard 4d3217f959
Run CI with Xcode 13 & Swift 5.5 (#3711)
Currently Xcode 13 beta 5, will switch to GM when available.
2021-09-10 09:24:39 -07: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
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
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
JP Simard b2b95cf403
Require Swift 5.2 or higher to build (#3413)
Swift 5.2 has been officially released for over 7 months now, there's no
reason to keep supporting earlier versions when _building_ SwiftLint.

However, SwiftLint still supports _linting_ back up to Swift 3.0.
2020-11-08 13:31:29 -05:00
JP Simard 59d6c2ef52
Test CI with official Swift 5.3 release (#3356) 2020-09-20 11:16:10 -04:00
JP Simard 81e8501dd5
Update SourceKitten and Yams 2020-08-24 22:27:13 -04:00
Marcelo Fabri 6cf3534db9 Setup codecov 2020-08-10 01:41:32 -07:00
Marcelo Fabri 1f5ee4d9fd Run tests on Xcode 12 as well 2020-08-04 02:45:42 -07:00
JP Simard 345933ebb1
Run CI on Linux Swift 5.2 (#3199)
* Run CI on Linux Swift 5.2

* fixup! Run CI on Linux Swift 5.2

* Move SwiftVersion tests to its own file
2020-05-06 14:16:17 -07:00
JP Simard 889dc49bb6
Remove support for compiling with 5.0.x (#3180)
* Remove support for compiling with 5.0.x

* fixup! Remove support for compiling with 5.0.x
2020-04-14 08:46:23 -07:00
JP Simard bc4b7d2962
Update CI to run jobs with Xcode 11.0 to 11.4 (#3168)
* Update CI to run jobs with Xcode 11.0 to 11.4

In the process, remove CI jobs running with Swift 5.0.x and indicate
in the changelog that the next release will be the last one to support
building with Swift 5.0.x.

* fixup! Update CI to run jobs with Xcode 11.0 to 11.4

* fixup! Update CI to run jobs with Xcode 11.0 to 11.4

* fixup! Update CI to run jobs with Xcode 11.0 to 11.4

* fixup! Update CI to run jobs with Xcode 11.0 to 11.4

* Disable Swift 5.2 tests on Linux due to SR-12500

* Update ruby gems

Mostly to get jazzy 0.13.2 with Swift 5.2 bug fixes.
2020-04-03 18:06:22 -07: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 37167a8a35
Add documentation comments to all public declarations (#3027) 2020-01-08 09:47:10 -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
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