Skip to content

Commit a2c5624

Browse files
committed
added swiftlint action
1 parent bfc5d38 commit a2c5624

4 files changed

Lines changed: 49 additions & 1 deletion

File tree

.github/workflows/swiftlint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: SwiftLint
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
paths:
7+
- '.github/workflows/swiftlint.yml'
8+
- '.swiftlint.yml'
9+
- '**/*.swift'
10+
pull_request:
11+
branches:
12+
- 'main'
13+
paths:
14+
- '.github/workflows/swiftlint.yml'
15+
- '.swiftlint.yml'
16+
- '**/*.swift'
17+
jobs:
18+
SwiftLint:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v1
22+
- name: GitHub Action for SwiftLint with --strict
23+
uses: norio-nomura/action-swiftlint@3.2.1
24+
with:
25+
args: --strict

.swiftlint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
disabled_rules:
2+
- todo
3+
- trailing_comma
4+
- nesting
5+
6+
type_name:
7+
excluded:
8+
- ID
9+
10+
identifier_name:
11+
min_length: 2
12+
allowed_symbols: ['_']
13+
excluded:
14+
- c
15+
- id
16+
- vc
17+
18+
excluded:
19+
- DerivedData

Sources/CodeEditLanguages/CodeLanguage.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ public extension CodeLanguage {
199199
static let json: CodeLanguage = .init(id: .json, tsName: "json", extensions: ["json"])
200200

201201
/// A language structure for `JSX`
202-
static let jsx: CodeLanguage = .init(id: .jsx, tsName: "javascript", extensions: ["jsx"], highlights: ["highlights-jsx"])
202+
static let jsx: CodeLanguage = .init(id: .jsx,
203+
tsName: "javascript",
204+
extensions: ["jsx"],
205+
highlights: ["highlights-jsx"])
203206

204207
/// A language structure for `PHP`
205208
static let php: CodeLanguage = .init(id: .php, tsName: "php", extensions: ["php"])

Tests/CodeEditLanguagesTests/CodeEditLanguagesTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import XCTest
99
@testable import CodeEditLanguages
1010
import SwiftTreeSitter
1111

12+
// swiftlint:disable all
1213
final class CodeEditLanguagesTests: XCTestCase {
1314

1415
// MARK: Bash

0 commit comments

Comments
 (0)