Commit Graph

52 Commits

Author SHA1 Message Date
Juozas Valančius a28516d5e8
Create `.artifactbundle` during release 2022-03-31 09:52:22 -04: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 d534a30a78
Fix OSSCheck (#3810)
Maybe can fix cases like these: https://github.com/realm/SwiftLint/pull/3803#issuecomment-1008461939
2022-01-21 18:09:59 +00:00
JP Simard aa32742abf
Revert OSSCheck changes for faster debugging 2021-03-03 14:43:37 -05:00
JP Simard 7f7fc03a8f
Fix OSSCheck noise
Try a few things:

1. Sort InclusiveLanguageRule terms since they're a Set and don't have
  deteministic ordering (will definitely help)
2. Fetch remote at the beginning of the script (likely to help)
3. Only fetch remote once (likely to help)
4. Sort branch & master output before diffing (unlikely to help)
5. Change diff filter from `d` to `AMRCU` (no idea if it will help)
2021-03-03 11:19:41 -05:00
JP Simard be21dc3b4b
Add scrip/get-version script
Previous way wasn't working and this way we edit one less file when
pushing new versions.
2020-11-23 11:15:52 -05: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
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
Marcelo Fabri aae9730ee1 Fix Jazzy
Don’t try to create ~/.ssh if it already exists
2020-08-05 15:22:25 -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
Marcelo Fabri 1ea070dbd5
Remove base path from reported message in oss-check (#3070) 2020-02-03 01:25:30 -08:00
JP Simard 5b5314ee70
Fix documentation in Version.swift 2020-01-08 12:14:42 -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 5f66704a1a
Improve compilation time (#2965)
* Improve compilation time

Before this change, `trailingClosure` took 8.6s to type check.
After this change, it takes 31ms.

* Speed up type checking `isDecimal(number:)`

Before: 377ms
After: 2ms

* Speed up type checking testViolationMessageForExpressibleByIntegerLiteral()

Before: 285ms
After: 175ms

* Fix OSSCheck

More than just rules are in `Source/SwiftLintFramework/Rules/`

* Shim XCTUnwrap for Swift 5.0
2019-11-15 11:36:25 -08:00
JP Simard 77e03656a6
[OSSCheck] Only run on changed rules if only rules have changed (#2950) 2019-11-08 14:34:19 -08:00
JP Simard da114c341c
Update Danger to 6.1.0 and fix issues with running on MacStadium (#2945)
And validate that running on PRs from forked repos works.
2019-11-06 14:51:57 -08:00
Marcelo Fabri 956ea6f949 Delete build artifacts before starting a new build 2019-10-08 08:57:15 -07:00
Elliott Williams 2b675c1bb3 Use popen2 in oss-check
Ruby's documentation mentions that `popen3` requires that you flush
stderr to prevent deadlocking:

> You should be careful to avoid deadlocks. Since pipes are fixed length
> buffers, ::popen3(“prog”) {|i, o, e, t| o.read } deadlocks if the
> program generates too much output on stderr. You should read stdout and
> stderr simultaneously (using threads or IO.select). However, if you
> don't need stderr output, you can use ::popen2.
2019-07-18 14:59:42 -07:00
JP Simard b83e0991b9
Remove all file headers
The MIT license doesn't require that all files be prepended with this
licensing or copyright information. Realm confirmed that they're ok with this
change. This will enable some companies to contribute to SwiftLint and the
date & authorship information will remain accessible via git source control.
2018-05-04 13:42:02 -07:00
Marcelo Fabri 3b004e1d1e Merge pull request #1804 from marcelofabri/fix-1803
Improve syntactic_sugar message to be type-specific
2017-08-28 00:18:43 +01:00
Marcelo Fabri b635d1ffa8 Escape HTML tags in oss-check 2017-08-27 18:15:17 -03:00
Ornithologist Coder 9a8e50b67f Prints the performance report before other messages
* Makes it easier to review the performance of a change that has hundreds
  of messages.
2017-08-27 20:30:09 +02:00
JP Simard bc9c86a2db
use 'perform' method 2017-07-13 13:36:53 -07:00
JP Simard 2bd8664a58
use the latest HEAD/master of the official SwiftLint repo as 'master'
otherwise, if forks have an out-of-date `master` branch, OSSCheck will be
wildly inaccurate.
2017-07-13 13:34:28 -07:00
JP Simard cdd4bdd1e6
refactor make_directory_structure 2017-07-13 13:33:54 -07:00
JP Simard 3261bb79f0
print newline before command in verbose mode 2017-07-13 13:33:21 -07:00
JP Simard 2974deb68a
apply stylistic fixes to oss-check from rubocop 2017-07-12 15:18:12 -07:00
JP Simard 4b5d00ed34
use merge-base to determine an "effective master commit-ish"
rather than explicitly 'master', which should help minimize noise
when running osscheck on a branch that isn't fully up to speed on
master.
2017-07-12 15:18:12 -07:00
Norio Nomura 1ee43c0d77
Improve OSSCheck
- Use same build directory to `branch` and `master` for incremental building
- Add options:
```terminal.sh-session
$ script/oss-check --help
Usage: oss-check [options]
        --branch BRANCH              compares the performance of BRANCH against 'master'
        --iterations N               iterates lint N times on each repositories
        --skip-clean                 skip cleaning on completion
    -v, --[no-]verbose               Run verbosely
```
2017-05-26 10:57:53 +09:00
JP Simard b7acce37c1
allow specifying the number of OSSCheck iterations as an argument
e.g.: `./script/oss-check 10`
2017-05-25 11:16:57 -07:00
Norio Nomura 568a024449
Use `git-worktree(1)` in `oss-check`
This makes it possible to run `oss-check` even if the repository is not clean.
2017-05-25 12:14:35 +09:00
JP Simard ae54fb7f2c Revert "Merge master before running OSSCheck on branch" 2017-05-07 22:27:48 -07:00
JP Simard b65a40c982
merge master before running OSSCheck on branch 2017-05-04 14:39:05 -07:00
JP Simard f3eac2b64a
revert number of iterations back from 2 to 5
it was set to 2 temporarily to speed up local development
2017-04-06 11:08:59 -07:00
JP Simard 846ac1da2e
completely reorganize source layout of oss-check 2017-04-06 10:52:29 -07:00
JP Simard 0d27bf86d7
warn when a PR changes the exit value 2017-04-06 10:52:29 -07:00
JP Simard 6b819a3318
split up repo setup 2017-04-06 10:52:29 -07:00
JP Simard 44e1294d61
introduce Repo class 2017-04-06 10:52:29 -07:00
JP Simard bda4958d61
simplify & solidify reverting checkout to original branch 2017-04-06 10:52:29 -07:00
JP Simard 9386dd134f
extract working directory to a variable 2017-04-06 10:52:29 -07:00
JP Simard 7a60813670
correct style violations in oss-check script 2017-04-06 10:52:29 -07:00
JP Simard da7712b2b1
small Danger/oss-check improvements 2017-02-03 12:14:10 -08:00
Marcelo Fabri 9ef603ca2f Fix links 2017-02-02 22:21:22 -02:00
Marcelo Fabri 5bfc819656 Fix cleanup
Using `git clean -qdf` removes bundler folder
2017-02-02 22:21:22 -02:00
Marcelo Fabri 92ba3d2297 Always use Xcode reporter on oss-check 2017-02-02 22:21:22 -02:00
Marcelo Fabri 5ce8ed7cd0 Use stderr 2017-02-02 22:21:22 -02:00
Marcelo Fabri ff00262558 Add oss-check script 2017-02-02 22:21:22 -02:00
JP Simard a16e77c39e
fix `swiftlint version` with SPM
all done by @marcelofabri, originally in #1073
2017-01-07 00:09:27 -08:00