Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into pull-in-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Killectro committed Dec 3, 2024
2 parents 12255d6 + f13c54c commit fbe5aef
Show file tree
Hide file tree
Showing 647 changed files with 14,204 additions and 5,817 deletions.
1 change: 0 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ build --disk_cache=~/.bazel_cache
build --experimental_remote_cache_compression
build --remote_build_event_upload=minimal
build --nolegacy_important_outputs
build --swiftcopt=-warnings-as-errors

build:release \
--compilation_mode=opt \
Expand Down
4 changes: 2 additions & 2 deletions .bcr/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fixedReleaser:
login: jpsim
email: jp@jpsim.com
login: SimplyDanny
email: danny.moesch@icloud.com
5 changes: 5 additions & 0 deletions .bcr/metadata.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"email": "[email protected]",
"github": "jpsim",
"name": "JP Simard"
},
{
"email": "[email protected]",
"github": "SimplyDanny",
"name": "Danny Mösch"
}
],
"repository": [
Expand Down
23 changes: 12 additions & 11 deletions .bcr/presubmit.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
shell_commands: &shell_commands
- "echo --- Downloading and extracting Swift $SWIFT_VERSION to $SWIFT_HOME"
- "mkdir $SWIFT_HOME"
- "curl https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu2004/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu20.04.tar.gz | tar xvz --strip-components=1 -C $SWIFT_HOME"

tasks:
verify_targets_linux:
name: Verify targets (Linux)
name: Verify Targets (Linux)
platform: ubuntu2004
bazel: 7.x
environment:
CC: "clang"
SWIFT_VERSION: "5.8.1"
SWIFT_VERSION: "5.10"
SWIFT_HOME: "$HOME/swift-$SWIFT_VERSION"
PATH: "$PATH:$SWIFT_HOME/usr/bin"
shell_commands: *shell_commands
shell_commands:
- "echo --- Downloading and extracting Swift $SWIFT_VERSION to $SWIFT_HOME"
- "mkdir $SWIFT_HOME"
- "curl https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu2004/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu20.04.tar.gz | tar xvz --strip-components=1 -C $SWIFT_HOME"
build_flags:
- "--action_env=PATH"
build_targets:
# TODO: Build `:swiftlint` target when the Swift compiler crash is fixed
- '@swiftlint//:SwiftLintFramework'
- '@swiftlint//:swiftlint'
verify_targets_macos:
name: Verify targets (macOS)
name: Verify Targets (macOS)
platform: macos
bazel: 7.x
build_targets:
- '@swiftlint//:swiftlint'
build_flags:
- "--repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1"
2 changes: 0 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ steps:
- bazel test --test_output=errors //Tests/...
- label: "Build With Strict Concurrency"
commands:
- echo "+++ Add @preconcurrency imports"
- ./tools/add-preconcurrency-imports.sh
- echo "+++ Build"
- bazel build --define strict_concurrency_builtin_rules=true :swiftlint
- echo "--- Clean up"
Expand Down
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Bug Report
about: Create a report to help us improve.

---

### New Issue Checklist

- [ ] I've Updated SwiftLint to the latest version.
- [ ] I've searched for [existing GitHub issues](https://github.com/realm/SwiftLint/issues).

### Bug Description

A clear and concise description of what the bug is. Ideally, provide a small (but compilable) example code snippet that
can be used to reproduce the issue.

```swift
// This triggers a violation:
let foo = try! bar()
```

Mention the command or other SwiftLint integration method that caused the issue. Include stack traces or command output.

```bash
$ swiftlint lint [--no-cache] [--fix]
```

### Environment

* SwiftLint version (run `swiftlint version` to be sure)
* Xcode version (run `xcodebuild -version` to be sure)
* Installation method used (Homebrew, CocoaPods, building from source, etc)
* Configuration file:

```yml
# insert yaml contents here
```

Are you using [nested configurations](https://github.com/realm/SwiftLint#nested-configurations)? If so, paste their
relative paths and respective contents.
42 changes: 0 additions & 42 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Feature or Enhancement Proposal
about: Let us know about a feature idea or propose an improvement.

---

### New Issue Checklist

- [ ] I've Updated SwiftLint to the latest version.
- [ ] I've searched for [existing GitHub issues](https://github.com/realm/SwiftLint/issues).

### Feature or Enhancement Proposal

Describe you idea or proposal here. This can be a new feature, an enhancement to an existing feature, or a change to the
project's behavior. Be sure to include the rationale behind the proposal and any relevant context or examples.
9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/rule-request.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Rule request
about: Share your idea for a new rule
name: Rule Request
about: Share your idea for a new rule.

---

Expand All @@ -9,10 +9,9 @@ about: Share your idea for a new rule
- [ ] Updated SwiftLint to the latest version
- [ ] I searched for [existing GitHub issues](https://github.com/realm/SwiftLint/issues)

### New rule request
### New Rule Request

Please describe the rule idea, format
this issue's title as `Rule Request: [Rule Name]` and describe:
Please describe the rule idea, format this issue's title as `Rule Request: [Rule Name]` and describe:

1. Why should this rule be added? Share links to existing discussion about what
the community thinks about this.
Expand Down
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Keep GitHub Actions up to date with GitHub's Dependabot...
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
version: 2
updates:
- package-ecosystem: github-actions
directory: /
groups:
github-actions:
patterns:
- "*" # Group all Actions updates into a single larger pull request
schedule:
interval: weekly
2 changes: 2 additions & 0 deletions .github/plugins-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SimplyDanny/SwiftLintPlugins:
- Plugins/
54 changes: 28 additions & 26 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,48 @@
name: docker
name: Docker Build

on:
push:
branches:
- main
tags:
- '*'
workflow_call:
inputs:
tag:
description: 'Docker tag'
required: true
type: string
default: 'latest'
workflow_dispatch:
inputs:
tag:
description: 'Docker tag'
required: true
type: string
default: 'latest'

jobs:
build:
runs-on: ubuntu-20.04

runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3

- name: Extract DOCKER_TAG using tag name
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "DOCKER_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: Use default DOCKER_TAG
if: startsWith(github.ref, 'refs/tags/') != true
run: |
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Set Docker tag
if: github.event_name != 'push' && ${{ inputs.tag }}
run: echo "DOCKER_TAG=${{ inputs.tag }}" >> $GITHUB_ENV
- name: Use default Docker tag
if: github.event_name == 'push'
run: echo "DOCKER_TAG=latest" >> $GITHUB_ENV
- name: Set lowercase repository name
run: |
echo "REPOSITORY_LC=${REPOSITORY,,}" >>${GITHUB_ENV}
run: echo "REPOSITORY_LC=${REPOSITORY,,}" >> $GITHUB_ENV
env:
REPOSITORY: '${{ github.repository }}'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

uses: docker/setup-buildx-action@v3
- name: Login to GitHub registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io

- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/${{ env.REPOSITORY_LC }}:${{ env.DOCKER_TAG }}
24 changes: 24 additions & 0 deletions .github/workflows/plugins-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Plugins Sync

on:
push:
branches:
- main
paths:
- 'Plugins/**'
workflow_dispatch:

jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run file sync
uses: BetaHuhn/repo-file-sync-action@v1
with:
GH_PAT: ${{ secrets.SIMPLYDANNY_PLUGINS_SYNC }}
IS_FINE_GRAINED: true
CONFIG_PATH: .github/plugins-sync.yml
SKIP_PR: true
COMMIT_PREFIX: 🔄 Workflow in 'realm/SwiftLint'
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release

on:
release:
types: [released]

jobs:
dispatch-plugins:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Parse checksum
id: parse_checksum
run: echo "checksum=$(grep -o '[a-fA-F0-9]\{64\}' Package.swift)" >> $GITHUB_OUTPUT
- name: Dispatch release of plugins package
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.SIMPLYDANNY_PLUGINS_SYNC }}
repository: SimplyDanny/SwiftLintPlugins
event-type: swiftlint-release
client-payload: |-
{
"title": "${{ github.event.release.name }}",
"tag": "${{ github.event.release.tag_name }}",
"checksum": "${{ steps.parse_checksum.outputs.checksum }}"
}
trigger-docker:
uses: ./.github/workflows/docker.yml
secrets: inherit
with:
tag: ${{ github.event.release.tag_name }}
upload-docker:
needs: trigger-docker
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Upload binary to existing release
run: make zip_linux_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-pod:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4
- name: Retrieve author in uppercase
id: retrieve_author
run: |
author=${{ github.event.release.author.login }}
AUTHOR=$(echo $author | tr '[:lower:]' '[:upper:]')
echo "name=${AUTHOR}" >> $GITHUB_OUTPUT
- name: Deploy to CocoaPods
run: make pod_publish
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets[format('COCOAPODS_TRUNK_TOKEN_{0}', steps.retrieve_author.outputs.name)] }}
11 changes: 0 additions & 11 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,3 @@ custom_categories:
- name: Rules
children:
- Rule Directory
- name: Reporters
children:
- CSVReporter
- CheckstyleReporter
- CodeClimateReporter
- EmojiReporter
- GitHubActionsLoggingReporter
- HTMLReporter
- JSONReporter
- JUnitReporter
- MarkdownReporter
2 changes: 1 addition & 1 deletion .sourcery/BuiltInRules.stencil
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/// The rule list containing all available rules built into SwiftLint.
public let builtInRules: [any Rule.Type] = [
{% for rule in types.structs where rule.name|hasSuffix:"Rule" %} {{ rule.name }}.self{% if not forloop.last %},{% endif %}
{% for rule in types.structs where rule.name|hasSuffix:"Rule" %} {{ rule.name }}.self,
{% endfor %}]
2 changes: 1 addition & 1 deletion .sourcery/GeneratedTests.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import SwiftLintTestHelpers

{% for rule in types.structs %}
{% if rule.name|hasSuffix:"Rule" %}
class {{ rule.name }}GeneratedTests: SwiftLintTestCase {
final class {{ rule.name }}GeneratedTests: SwiftLintTestCase {
func testWithDefaultConfiguration() {
verifyRule({{ rule.name }}.description)
}
Expand Down
Loading

0 comments on commit fbe5aef

Please sign in to comment.