Commit Graph

169 Commits

Author SHA1 Message Date
Danny Mösch a41c49aff4 Kepp build running with a single job 2025-08-08 10:50:53 +02:00
Danny Mösch 571e6c1818 Run remaining Azure build jobs on GitHub Actions (#6149) 2025-07-09 22:43:50 +02:00
JP Simard 775174b03a [CI] Use Bazel for "Register" job (#6110)
Which should be much faster than the previous SwiftPM build in the
common case of not having to rebuild SwiftSyntax.
2025-06-19 21:42:00 -04:00
Danny Mösch 9710148f76 Replace Sourcery with internal implementation (#6034)
Tasks we perform with Sourcery are rather simple and can be replaced
with a basic collection of files and the generation of lists in the
new `swiftlint-dev` command. This spares contributors from installing
either Sourcery or Bazel.
2025-03-26 20:38:53 +00:00
Danny Mösch a4db2f65c0 Skip integration tests in CI intentionally (#6017) 2025-03-09 20:26:39 +01:00
Danny Mösch b2312b50b6 Update Docker image used in testing 2025-02-08 21:23:01 +01:00
Danny Mösch 6cf862c655 Move more build steps into Makefile (#5975) 2025-01-23 18:05:21 +00:00
Danny Mösch b52aea7752 Remove CocoaPods lint job from PR builds in favor of a single pre-release check 2025-01-19 13:20:39 +01:00
Danny Mösch f6e4adc065 Run Pod publishing on Xcode 15.0.1
CocoaPods selects the oldest SDK/simulator available on a machine. On
Github Action runners, this would be iOS 17, which only works with
Xcode 15.0.1.
2025-01-18 14:00:27 +01:00
Danny Mösch 6d0f416913 Move files to the same level before upload 2025-01-11 17:30:42 +01:00
Danny Mösch b6d14db9df Transfer Bazel release between jobs 2025-01-11 16:46:40 +01:00
Danny Mösch d0a2bfdb5a Ensure that binaries are executable 2025-01-11 15:06:03 +01:00
Danny Mösch f54840f8ba Build Linux and macOS binaries in parallel and upload them 2025-01-11 13:11:00 +01:00
Danny Mösch 7421e24fc2 Use action to extract binary from Docker image 2025-01-11 00:04:53 +01:00
Danny Mösch 803243ca6f Upload artifact only in workflow 2025-01-10 22:41:19 +01:00
Danny Mösch c8ae928776 Skip formula bump temporarily 2025-01-09 20:15:24 +01:00
Danny Mösch a6c4fd98bc Move files from SwiftLintCore to SwiftLintFramework
Ideally, SwiftLintCore would some day only contain components
that are needed to define rules. Consequently, it would be the
only bundle required to import for (external) rule development.
2024-12-23 12:51:43 +01:00
Bradley Mackey daebaa3115 Include AMD64 Linux binary in artifactbundle (#5866) 2024-11-27 21:30:22 +00:00
Danny Mösch 8db0fbf6e8 Extend clean command 2024-09-29 19:18:02 +02:00
Danny Mösch 551adb047f Automate Pod publishing 2024-09-08 16:00:00 +02:00
Danny Mösch 6620d8a5da Capitalize release commit message 2024-05-12 00:29:49 +02:00
Danny Mösch 0e9db3a065 Revert "Create draft release and skip publishing steps temporarily"
This reverts commit 84710bd6ff.
2024-05-12 00:27:18 +02:00
Danny Mösch 84710bd6ff Create draft release and skip publishing steps temporarily 2024-05-11 23:08:13 +02:00
Danny Mösch 2433e7b5bf Make use of macros to generate configuration parsing code (#5250) 2023-10-02 22:35:24 +02:00
JP Simard 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 f62411e002 Stop generating tests for core rules (#5225) 2023-09-17 22:13:10 +00:00
JP Simard 07740506b5 Automate adding a new changelog section after releasing (#5016) 2023-05-17 10:36:31 -04:00
JP Simard 15a18fd4e8 Merge make release with make publish (#5003)
To simplify the release process.
2023-05-12 09:58:06 -04:00
JP Simard 8827fca693 Automate GitHub Release Creation (#4995)
* Add `tools/generate-release-notes.sh` script
* Add `tools/create-github-release.sh` script
* Update `Releasing.md`
2023-05-11 14:01:29 -04:00
JP Simard 6cdb0aa689 Update make publish
To use the CocoaPods version from bundler and to remove the stale
workaround.
2023-05-11 11:03:28 -04:00
JP Simard a7bc9e20c7 Move built-in rules to new SwiftLintBuiltInRules module (#4950) 2023-04-27 11:16:01 -04:00
JP Simard 86d60400c1 Move core SwiftLint functionality to new SwiftLintCore module
Over the years, SwiftLintFramework had become a fairly massive monolith,
containing over 400 source files with both core infrastructure and
rules.

Architecturally, the rules should rely on the core infrastructure but
not the other way around. There are two exceptions to this:
`custom_rules` and `superfluous_disable_command` which need special
integration with the linter infrastructure.

Now the time has come to formalize this architecture and one way to do
that is to move the core SwiftLint functionality out of
SwiftLintFramework and into a new SwiftLintCore module that the rules
can depend on.

Beyond enforcing architectural patterns, this also has the advantage of
speeding up incremental compilation by skipping rebuilding the core
functionality when iterating on rules.

Because the core functionality is always useful when building rules, I'm
opting to import SwiftLintCore in SwiftLintFramework as `@_exported` so
that it's implicitly available to all files in SwiftLintFramework
without needing to import it directly.

In a follow-up I'll also split the built-in rules and the extra rules
into their own modules. More modularization is possible from there, but
not planned.

The bulk of this PR just moves files from `Source/SwiftLintFramework/*`
to `Source/SwiftLintCore/*`. There are some other changes that can't be
split up into their own PRs:

* Change jazzy to document the SwiftLintCore module instead of
  SwiftLintFramework.
* Change imports in unit tests to reflect where code was moved to.
* Update `sourcery` make rule to reflect where code was moved to.
* Create a new `coreRules` array and register those rules with the
  registry. This allows the `custom_rules` and
  `superfluous_disable_command` rule implementations to remain internal
  to the SwiftLintCore module, preventing more implementation details
  from leaking across architectural layers.
* Move `RuleRegistry.registerAllRulesOnce()` out of the type declaration
  and up one level so it can access rules defined downstream from
  SwiftLintCore.
2023-04-26 21:10:19 -04:00
JP Simard 740572f049 Move Version.swift to SwiftLintCore 2023-04-26 21:10:19 -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
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
Martin Redington 7dad240ea7 Add a reporters subcommand (#4836) 2023-03-31 08:09:01 +02:00
JP Simard 62b9c2de7a Don't run make clean automatically on build
Since when releasing, many steps depend on the `build`, so we don't want
to clean mid-way through releasing.

Explicitly run `make clean` at the start of `make release`.
2023-03-27 11:22:00 -04:00
JP Simard 183c0aa784 Set --platform linux/amd64 in make zip_linux_release
So it works on other architectures (e.g. Apple Silicon)
2023-02-20 17:00:48 -05:00
Keith Smiley 23e4db3e5f Add support for bzlmod (#4704) 2023-01-19 17:04:21 -05:00
Julio Carrettoni d3928cb8e8 Update docker_test to swift 5.7 (#4625) 2022-12-19 19:12:44 -03:00
JP Simard 53ee4a955d Fix make release
`make package` has a dependency on `make clean` so this was removing
the bazel release artifacts.
2022-12-09 14:42:20 -05:00
Tony Arnold ab143685a4 Use a binary target for the build tool plugin (#4603)
* Use a binary target for the build tool plugin

* Merge `push_version` and `release` make commands

Instead of running `make push_version "0.2.0: Tumble Dry"` and then
`make release`, now run `make release "0.2.0: Tumble Dry"`, which will
build the release artifacts and update/push the new version to GitHub.

This allows the artifacts to use the new version, update the artifact
bundle checksum in the package manifest, then tag the release.

The Releasing.md instructions were updated to reflect this new workflow.

* Add `SwiftLintSourcePlugin` source plugin for SwiftPM

* Add changelog entry

* Remove SwiftLintSourcePlugin for now

* Build from Source on Linux

* Use a lower-level method of checking if a file is accessible

This shouldn’t trigger sandbox violations, I hope…

* Prevent an infinite recursion of the filesystem root

* Remove unnecessary logging

* Quieten the output so that Xcode only prints violations

* Break up comment to avoid line length warning

* Fix capitalization of Glibc import

Co-authored-by: JP Simard <jp@jpsim.com>
2022-11-29 18:10:47 -05:00
JP Simard a6c4ea9614 Makefile: use bazel in more places (#4580)
Previously, it took a very long time to run `make release` since it had
to clean build everything.

With bazel, I'm more confident in incremental builds being solid, so it
now just takes a few seconds if there's anything cached, which is often
the case.
2022-11-23 21:41:28 +00:00
JP Simard b9653e3e1b Replace swift run with swift build --product (#4357) 2022-10-12 15:51:10 -04:00
JP Simard 3ac518ce69 Only build swiftlint target in Makefile (#4327)
Otherwise this tries to build the SwiftLintTestHelpers module in release
mode, which fails.

Also, to build the actual executable CLI, we can't just
`swift build --target=swiftlint` because that doesn't produce a CLI,
just the object file for the binary. So we have to `swift run`.
2022-10-07 16:50:56 +00:00
JP Simard 5ae1d98596 Create new GeneratedTests and IntegrationTests test targets (#4304)
* Move generated rule tests to a dedicated GeneratedTests target
* Move integration tests to a dedicated IntegrationTests target

This will improve bazel cacheability by having fewer tests depend on all
lint inputs, which are only needed by the integration tests.
2022-10-06 00:10:04 -04: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 69f3a3b4b7 Refactor bazel release rule
Moving the signature file generation from the Makefile to the bazel rule
2022-08-22 12:26:22 -04:00
JP Simard e8f738b39c Automate producing release tarballs for Bazel (#4113) 2022-08-19 17:26:21 +00:00