@@ -36,3 +36,17 @@ jobs:
|
|||||||
working-directory: ./tree-sitter-p4
|
working-directory: ./tree-sitter-p4
|
||||||
- run: swift build
|
- run: swift build
|
||||||
- run: swift test
|
- run: swift test
|
||||||
|
library-format-tests:
|
||||||
|
name: Library Format Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
- uses: tree-sitter/setup-action@v2
|
||||||
|
- uses: swift-actions/setup-swift@v2
|
||||||
|
with:
|
||||||
|
swift-version: "6.2"
|
||||||
|
- run: tree-sitter generate
|
||||||
|
working-directory: ./tree-sitter-p4
|
||||||
|
- run: ./ci/format.sh
|
||||||
|
|
||||||
|
|||||||
@@ -33,5 +33,5 @@ For more information, see the [documentation for the Swift-DocC plugin](https://
|
|||||||
To check the format:
|
To check the format:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ swift package plugin --allow-writing-to-package-directory swiftformat
|
$ swift-format --recursive -i Sources/
|
||||||
```
|
```
|
||||||
Executable
+13
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Format
|
||||||
|
swift format --recursive -i Sources/ 2>&1 >/dev/null
|
||||||
|
|
||||||
|
# Modified count
|
||||||
|
mc=`git status . | grep modified | wc -l | sed 's/ //g'`
|
||||||
|
|
||||||
|
if [ ${mc} -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
Reference in New Issue
Block a user