Skip to content

Commit d5591aa

Browse files
committed
Add pre-commit license check and missing license headers
1 parent 53c9271 commit d5591aa

File tree

6 files changed

+59
-35
lines changed

6 files changed

+59
-35
lines changed

.licenserc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ header:
44
paths:
55
- '**/*.java'
66
- '**/*.kt'
7+
- '**/*.kts'
78
paths-ignore:
89
- '**/*.md'
910
- '**/.git/**'

.pre-commit-config.yaml

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,55 @@
1+
# Setting up a Python environment and pre-commit.
2+
3+
# Unix or MacOS:
4+
# >>> python3 -m venv venv
5+
# >>> source venv/bin/activate
6+
7+
# Windows:
8+
# >>> python -m venv venv
9+
# >>> venv\Scripts\activate.bat
10+
11+
# >>> pip install --upgrade pip
12+
# >>> pip install pre-commit
13+
# >>> pre-commit install
14+
# >>> pre-commit run --all-files
15+
116
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
4-
hooks:
5-
- id: trailing-whitespace
6-
files: \.kt$
7-
- id: end-of-file-fixer
8-
files: \.kt$
9-
- id: check-yaml
10-
11-
- repo: local
12-
hooks:
13-
- id: formatKotlin
14-
name: formatKotlin
15-
entry: sh -c './gradlew formatKotlin'
16-
language: system
17-
types: [kotlin]
18-
files: \.kt$
19-
20-
- id: ktlint
21-
name: ktlint
22-
entry: sh -c './gradlew lintKotlin'
23-
language: system
24-
types: [kotlin]
25-
files: \.kt$
26-
27-
- id: detekt
28-
name: detekt
29-
entry: sh -c './gradlew detekt'
30-
language: system
31-
types: [kotlin]
32-
files: \.kt$
17+
- repo: https://github.com/pre-commit/pre-commit-hooks
18+
rev: v6.0.0
19+
hooks:
20+
- id: trailing-whitespace
21+
files: \.kt$
22+
- id: end-of-file-fixer
23+
files: \.kt$
24+
- id: check-yaml
25+
26+
- repo: https://github.com/to-sta/spdx-checker-pre-commit
27+
rev: 0.1.3
28+
hooks:
29+
- id: spdx-license-checker
30+
name: run spdx-checker license check
31+
args: [-l, GPL-3.0-or-later]
32+
types_or: [kotlin]
33+
34+
- repo: local
35+
hooks:
36+
- id: formatKotlin
37+
name: formatKotlin
38+
entry: sh -c './gradlew formatKotlin'
39+
language: system
40+
types: [kotlin]
41+
files: \.kt$
42+
43+
- id: ktlint
44+
name: ktlint
45+
entry: sh -c './gradlew lintKotlin'
46+
language: system
47+
types: [kotlin]
48+
files: \.kt$
49+
50+
- id: detekt
51+
name: detekt
52+
entry: sh -c './gradlew detekt'
53+
language: system
54+
types: [kotlin]
55+
files: \.kt$

app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
12
import java.io.FileInputStream
23
import java.util.Locale
34
import java.util.Properties

app/src/test/kotlin/helpers/ComprehensiveCoverageTest.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
/*
2-
* SPDX-License-Identifier: GPL-3.0-or-later
3-
*/
4-
1+
// SPDX-License-Identifier: GPL-3.0-or-later
52
package helpers
63
import android.provider.SyncStateContract.Constants
74
import androidx.test.ext.junit.runners.AndroidJUnit4

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
12
// Top-level build file where you can add configuration options common to all sub-projects/modules.
23

34
buildscript {

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
12
rootProject.name = "Scribe-Android"
23
include(":app")

0 commit comments

Comments
 (0)