forked from realm/SwiftLint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into pull-in-upstream
- Loading branch information
Showing
647 changed files
with
14,204 additions
and
5,817 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,11 @@ | |
"email": "[email protected]", | ||
"github": "jpsim", | ||
"name": "JP Simard" | ||
}, | ||
{ | ||
"email": "[email protected]", | ||
"github": "SimplyDanny", | ||
"name": "Danny Mösch" | ||
} | ||
], | ||
"repository": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SimplyDanny/SwiftLintPlugins: | ||
- Plugins/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)] }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.