Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: realm/SwiftLint
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.55.1
Choose a base ref
...
head repository: realm/SwiftLint
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.56.0
Choose a head ref

Commits on May 16, 2024

  1. Add new changelog section

    SimplyDanny committed May 16, 2024
    Copy the full SHA
    21bdaf0 View commit details
  2. Fix indentation

    SimplyDanny committed May 16, 2024
    Copy the full SHA
    219f47c View commit details
  3. Copy the full SHA
    d7cf2fe View commit details

Commits on May 17, 2024

  1. Copy the full SHA
    ebf7c70 View commit details
  2. Copy the full SHA
    b42f6ff View commit details

Commits on Jun 18, 2024

  1. Copy the full SHA
    da4ba02 View commit details
  2. Copy the full SHA
    5b2f3a4 View commit details

Commits on Jun 19, 2024

  1. Copy the full SHA
    61e92fe View commit details

Commits on Jun 20, 2024

  1. Copy the full SHA
    bab4c12 View commit details
  2. Copy the full SHA
    4c11a10 View commit details
  3. Copy the full SHA
    3e8a051 View commit details

Commits on Jun 22, 2024

  1. Copy the full SHA
    47ef99c View commit details
  2. Copy the full SHA
    ff96d16 View commit details
  3. Copy the full SHA
    6431b95 View commit details
  4. Copy the full SHA
    72069bf View commit details
  5. Use SwiftSyntax version 600.0.0-prerelease-2024-03-11 (#5527)

    We can also switch back to an exact SwiftSyntax version now with the
    plugins in a separate repository. In fact, using the plugin, no direct
    dependency to SwiftSyntax is required whatsoever.
    SimplyDanny authored Jun 22, 2024
    Copy the full SHA
    914fa02 View commit details
  6. Copy the full SHA
    2d28166 View commit details
  7. Enable upcoming Swift 6 features (#5639)

    * Import Objective-C Forward Declarations
    * Forward Trailing Closures
    * Internal Imports by Default
    * Implicit Open Existentials
    SimplyDanny authored Jun 22, 2024
    Copy the full SHA
    d5dc142 View commit details
  8. Copy the full SHA
    1f4b422 View commit details
  9. Make vertical_whitespace_between_cases rule work when case block en…

    …ds with a string literal (#5628)
    ilendemli authored Jun 22, 2024
    Copy the full SHA
    fa5f98f View commit details
  10. Fix typo in README (#5621)

    miltenkot authored Jun 22, 2024
    Copy the full SHA
    3b19e7d View commit details

Commits on Jun 26, 2024

  1. Copy the full SHA
    251fb85 View commit details
  2. Bump the github-actions group with 4 updates (#5644)

    Bumps the github-actions group with 4 updates: [actions/checkout](https://github.com/actions/checkout), [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action), [docker/login-action](https://github.com/docker/login-action) and [docker/build-push-action](https://github.com/docker/build-push-action).
    
    
    Updates `actions/checkout` from 3 to 4
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@v3...v4)
    
    Updates `docker/setup-buildx-action` from 1 to 3
    - [Release notes](https://github.com/docker/setup-buildx-action/releases)
    - [Commits](docker/setup-buildx-action@v1...v3)
    
    Updates `docker/login-action` from 1 to 3
    - [Release notes](https://github.com/docker/login-action/releases)
    - [Commits](docker/login-action@v1...v3)
    
    Updates `docker/build-push-action` from 2 to 6
    - [Release notes](https://github.com/docker/build-push-action/releases)
    - [Commits](docker/build-push-action@v2...v6)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-major
      dependency-group: github-actions
    - dependency-name: docker/setup-buildx-action
      dependency-type: direct:production
      update-type: version-update:semver-major
      dependency-group: github-actions
    - dependency-name: docker/login-action
      dependency-type: direct:production
      update-type: version-update:semver-major
      dependency-group: github-actions
    - dependency-name: docker/build-push-action
      dependency-type: direct:production
      update-type: version-update:semver-major
      dependency-group: github-actions
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jun 26, 2024
    Copy the full SHA
    3afad91 View commit details

Commits on Jun 27, 2024

  1. Adds baseline and write_baseline config file options (#5552)

    * Adds `baseline` and `write_baseline` config file options, so baseline can be used by people who can't pass command line arguments (e.g. plugin users).
    
    * Added PR number
    
    * Fixed change log entry
    
    * Update Source/swiftlint/Helpers/LintOrAnalyzeCommand.swift
    
    Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
    
    * updated
    
    ---------
    
    Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
    mildm8nnered and SimplyDanny authored Jun 27, 2024
    Copy the full SHA
    8bed208 View commit details

Commits on Jun 28, 2024

  1. Copy the full SHA
    5c195a4 View commit details
  2. Print only file path when reporting a correction (#5596)

    Omit exact line and column information. Keep the internal logic
    available for a while in case people complain for good reasons. Then
    the change can be reverted easily.
    
    Reasons behind this change:
    
    * What is the position of a correction actually? The position where the rule triggered? The position of the transformed node?
    * If there's more than a single fix, it's highly likely that all positions (except for the first) are wrong no matter what the answer to the first question is.
    * Getting the positions right in a rewriter is hard. And there is always the feeling that something is wrong with them - probably because it is.
    * Even if you get the positions right in a single rule: One run collects positions for all rules that apply to a file and so rewrites in other rules might draw existing positions wrong.
    * We already have checks for more than one correction position disabled in tests due to these issues.
    SimplyDanny authored Jun 28, 2024
    Copy the full SHA
    09edd52 View commit details
  3. Copy the full SHA
    c810459 View commit details

Commits on Jun 29, 2024

  1. Add new no_empty_block rule (#5617)

    Ueeek authored Jun 29, 2024
    Copy the full SHA
    aa9f474 View commit details
  2. Copy the full SHA
    d274a81 View commit details
  3. Copy the full SHA
    593bb62 View commit details

Commits on Jul 2, 2024

  1. Rewrite missing_docs rule with SwiftSyntax (#5048)

    Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
    woxtu and SimplyDanny authored Jul 2, 2024
    Copy the full SHA
    6642d45 View commit details

Commits on Jul 6, 2024

  1. Copy the full SHA
    e0b9295 View commit details

Commits on Jul 7, 2024

  1. Copy the full SHA
    714bf4c View commit details
  2. Copy the full SHA
    f41c456 View commit details

Commits on Jul 9, 2024

  1. Copy the full SHA
    202adf0 View commit details

Commits on Jul 10, 2024

  1. Copy the full SHA
    ed10aec View commit details
  2. Copy the full SHA
    c6a7dd2 View commit details
  3. Copy the full SHA
    21b7e5e View commit details

Commits on Jul 14, 2024

  1. Copy the full SHA
    e48bdb7 View commit details
  2. Copy the full SHA
    67b1aaa View commit details
  3. Copy the full SHA
    cc4b569 View commit details

Commits on Jul 15, 2024

  1. Copy the full SHA
    b1234e3 View commit details

Commits on Jul 16, 2024

  1. Copy the full SHA
    e54f939 View commit details
  2. Copy the full SHA
    2442e10 View commit details

Commits on Jul 17, 2024

  1. Copy the full SHA
    1faaf10 View commit details

Commits on Jul 18, 2024

  1. Copy the full SHA
    3421f5f View commit details

Commits on Jul 20, 2024

  1. Place corrections optionally into violations (#5680)

    This avoids maintaining two lists of objects.
    SimplyDanny authored Jul 20, 2024
    Copy the full SHA
    238415b View commit details
  2. Fix some typos (#5683)

    SimplyDanny authored Jul 20, 2024
    Copy the full SHA
    9f8a3f5 View commit details
  3. Verify and document fixed opening_brace correction (#5620)

    Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
    swiftty and SimplyDanny authored Jul 20, 2024
    Copy the full SHA
    cb0f5ab View commit details
  4. Copy the full SHA
    b63807d View commit details
Showing 561 changed files with 6,164 additions and 3,467 deletions.
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.

---

@@ -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.
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/
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Extract DOCKER_TAG using tag name
if: startsWith(github.ref, 'refs/tags/')
@@ -31,16 +31,16 @@ jobs:
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 }}
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 }}
27 changes: 27 additions & 0 deletions .github/workflows/plugins-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Plugins Release

on:
release:
types: [released]

jobs:
dispatch:
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.ref_name }}",
"checksum": "${{ steps.parse_checksum.outputs.checksum }}"
}
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'
11 changes: 0 additions & 11 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -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/ReportersList.stencil
Original file line number Diff line number Diff line change
@@ -2,6 +2,6 @@
/// The reporters list containing all the reporters built into SwiftLint.
public let reportersList: [any Reporter.Type] = [
{% for reporter in types.structs where reporter.name|hasSuffix:"Reporter" %}
{{ reporter.name }}.self{% if not forloop.last %},{% endif %}
{{ reporter.name }}.self,
{% endfor %}
]
14 changes: 9 additions & 5 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ included:
- Plugins
- Source
- Tests
- Package.swift
excluded:
- Tests/SwiftLintFrameworkTests/Resources

@@ -15,8 +16,8 @@ opt_in_rules:
disabled_rules:
- anonymous_argument_in_multiline_closure
- anyobject_protocol
- closure_body_length
- conditional_returns_on_newline
- contrasted_opening_brace
- convenience_type
- discouraged_optional_collection
- explicit_acl
@@ -26,22 +27,18 @@ disabled_rules:
- file_types_order
- force_unwrapping
- function_default_parameter_at_end
- implicit_return
- indentation_width
- inert_defer
- missing_docs
- multiline_arguments
- multiline_arguments_brackets
- multiline_function_chains
- multiline_literal_brackets
- multiline_parameters
- multiline_parameters_brackets
- no_extension_access_modifier
- no_grouping_extension
- no_magic_numbers
- one_declaration_per_file
- prefer_nimble
- prefer_self_in_static_references
- prefixed_toplevel_constant
- required_deinit
- sorted_enum_cases
@@ -63,6 +60,9 @@ balanced_xctest_lifecycle: &unit_test_configuration
test_parent_classes:
- SwiftLintTestCase
- XCTestCase
closure_body_length:
warning: 50
error: 100
empty_xctest_method: *unit_test_configuration
file_name:
excluded:
@@ -79,9 +79,13 @@ identifier_name:
large_tuple: 3
number_separator:
minimum_length: 5
prefer_key_path:
restrict_to_standard_functions: false
redundant_type_annotation:
consider_default_literal_types_redundant: true
single_test_class: *unit_test_configuration
trailing_comma:
mandatory_comma: true
type_body_length: 400
unneeded_override:
affect_initializers: true
8 changes: 8 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -28,6 +28,14 @@ config_setting(
copts = [
"-enable-upcoming-feature",
"ExistentialAny",
"-enable-upcoming-feature",
"ConciseMagicFile",
"-enable-upcoming-feature",
"ImportObjcForwardDeclarations",
"-enable-upcoming-feature",
"ForwardTrailingClosures",
"-enable-upcoming-feature",
"ImplicitOpenExistentials",
]

strict_concurrency_copts = [
Loading