Skip to content

Commit 63abac9

Browse files
committed
ci: adopt the swift6-module-template 16.6.0 lint workflow
Prettier checks files that are not Markdown. markdownlint checks Markdown.
1 parent f74c8b8 commit 63abac9

9 files changed

Lines changed: 78 additions & 16 deletions

File tree

‎.editorconfig‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# UTF-8, LF, and spaces.
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
max_line_length = 120
11+
12+
# Two trailing spaces are a Markdown hard break.
13+
[*.md]
14+
trim_trailing_whitespace = false
15+
max_line_length = off

‎.github/workflows/lint.yml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
# Runs on all pull requests targeting any branch
8+
branches: ["**"]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
lint:
15+
name: Prettier & Markdownlint
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v7
21+
22+
- name: Setup Node.js (tool runtime)
23+
uses: actions/setup-node@v7
24+
with:
25+
node-version: "lts/*" # Floating version is appropriate specifically for Prettier and markdownlint
26+
27+
- name: Check formatting (Prettier)
28+
# Command fails if any files do not meet the formatting rules.
29+
run: npx prettier@latest --check .
30+
31+
- name: Check Markdown (markdownlint)
32+
# Command fails if any markdown files do not meet the linting rules.
33+
run: npx markdownlint-cli@latest "**/*.md"

‎.markdownlint.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"MD013": false
3+
}

‎.markdownlintignore‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Release Please writes this file
2+
3+
CHANGELOG.md
4+
5+
# The MIT license text is not a Markdown document.
6+
7+
LICENSE.md

‎.prettierignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.md
2+
/.build/
3+
/dist/
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"colors" : [
2+
"colors": [
33
{
4-
"idiom" : "universal"
4+
"idiom": "universal"
55
}
66
],
7-
"info" : {
8-
"author" : "xcode",
9-
"version" : 1
7+
"info": {
8+
"author": "xcode",
9+
"version": 1
1010
}
1111
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"images" : [
2+
"images": [
33
{
4-
"idiom" : "universal",
5-
"platform" : "ios",
6-
"size" : "1024x1024"
4+
"idiom": "universal",
5+
"platform": "ios",
6+
"size": "1024x1024"
77
}
88
],
9-
"info" : {
10-
"author" : "xcode",
11-
"version" : 1
9+
"info": {
10+
"author": "xcode",
11+
"version": 1
1212
}
1313
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"info" : {
3-
"author" : "xcode",
4-
"version" : 1
2+
"info": {
3+
"author": "xcode",
4+
"version": 1
55
}
66
}

‎README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# FDWaveformView
22

3-
[![ci](https://github.com/fulldecent/FDWaveformView/actions/workflows/ci.yml/badge.svg)](https://github.com/fulldecent/FDWaveformView/actions/workflows/ci.yml)
3+
[![ci](https://github.com/fulldecent/FDWaveformView/actions/workflows/ci.yml/badge.svg)](https://github.com/fulldecent/FDWaveformView/actions/workflows/ci.yml) [![Lint](https://github.com/fulldecent/FDWaveformView/actions/workflows/lint.yml/badge.svg)](https://github.com/fulldecent/FDWaveformView/actions/workflows/lint.yml)
44

55
FDWaveformView displays audio waveforms in Swift apps so users can preview audio, scrub, and pick positions with ease.
66

@@ -144,3 +144,4 @@ In the repository settings, under Actions, General, Workflow permissions, select
144144
- This project's layout is based on <https://github.com/fulldecent/swift6-module-template>
145145
- Ignore rules are inlined from [Swift.gitignore](https://github.com/github/gitignore/blob/main/Swift.gitignore) and [Global/Xcode.gitignore](https://github.com/github/gitignore/blob/main/Global/Xcode.gitignore). The macOS and secret rules above them come from [project-template](https://github.com/fulldecent/project-template).
146146
- Releases follow [swift6-module-template](https://github.com/fulldecent/swift6-module-template/blob/v16.5.0/.github/workflows/release.yml), release 16.5.0. The published result here is the git tag. That template publishes a Linux static library, and this module imports UIKit.
147+
- [lint.yml](.github/workflows/lint.yml), [.editorconfig](.editorconfig), [.markdownlint.json](.markdownlint.json), [.markdownlintignore](.markdownlintignore), and [.prettierignore](.prettierignore) follow [swift6-module-template](https://github.com/fulldecent/swift6-module-template) release [16.6.0](https://github.com/fulldecent/swift6-module-template/releases/tag/v16.6.0). Prettier checks files that are not Markdown. markdownlint checks Markdown. The commands are in that template's Development section.

0 commit comments

Comments
 (0)