Skip to content

Commit

Permalink
chore: configure lefthook commands
Browse files Browse the repository at this point in the history
  • Loading branch information
mym0404 committed May 8, 2024
1 parent eeb1cac commit b624561
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .eslintcache

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules/
lib/
expo-config-plugin/
docs/
expo-config-plugin/build
docs/
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
distribution: 'zulu'
java-version: '17'

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/wrapper
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}-lint
restore-keys: |
${{ runner.os }}-gradle-${{matrix.arch}}-lint-
# - name: Cache Gradle
# uses: actions/cache@v4
# with:
# path: |
# ~/.gradle/wrapper
# ~/.gradle/caches
# key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}-lint
# restore-keys: |
# ${{ runner.os }}-gradle-${{matrix.arch}}-lint-

- name: Install ktlint
run: |
Expand Down
24 changes: 11 additions & 13 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,45 @@ pre-commit:
parallel: true
commands:
lint:js:
glob: "src/**/*.{js,ts,jsx,tsx}"
glob: "*.{js,ts,jsx,tsx}"
run: yarn eslint --cache --max-warnings=0 {staged_files}
lint:objc:
glob: "ios/**/*.{h,mm,m,hpp}"
glob: "ios/**/*.{h,mm,m,hpp,cpp,c}"
run: bash ./script/clang-lint.sh {staged_files}
lint:kotlin:
glob: "android/**/*.kt"
run: bash ./script/ktlint-lint.sh {staged_files}
typecheck:
glob: "src/**/*.{ts,tsx}"
glob: "*.{ts,tsx}"
run: yarn tsc --noEmit

format:
parallel: true
commands:
format:objc:
glob: "ios/**/*.{h,mm,m,hpp}"
glob: "ios/**/*.{h,mm,m,hpp,cpp,c}"
run: bash ./script/clang-format.sh {all_files}
format:kotlin:
run: bash ./script/ktlint-format.sh android
glob: "android/**/*.kt"
run: bash ./script/ktlint-format.sh {all_files}

check:
parallel: true
commands:
lint:js:
glob: "src/**/*.{js,ts,jsx,tsx}"
glob: "*.{js,ts,jsx,tsx}"
run: yarn eslint --cache --max-warnings=0 {all_files}
lint:objc:
glob: "ios/**/*.{h,mm,m,hpp}"
glob: "ios/**/*.{h,mm,m,hpp,cpp,c}"
run: bash ./script/clang-lint.sh {all_files}
lint:kotlin:
run: bash ./script/ktlint-lint.sh android
glob: "android/**/*.kt"
run: bash ./script/ktlint-lint.sh {all_files}
typecheck:
glob: "src/**/*.{ts,tsx}"
glob: "*.{ts,tsx}"
run: yarn tsc --noEmit
build:
run: yarn prepack
codegen:ios:
run: yarn codegen:ios
codegen:android:
run: yarn codegen:android


commit-msg:
Expand Down
6 changes: 2 additions & 4 deletions script/ktlint-format.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env bash
set -e
for file in "$@"; do
echo "🌊 ktlint android $file"
ktlint --color --format --relative --editorconfig=example/android/.editorconfig $file
done
#echo "🌊 ktlint android $file"
ktlint --color --format --relative --editorconfig=example/android/.editorconfig "$@"
6 changes: 2 additions & 4 deletions script/ktlint-lint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env bash
set -e

for file in "$@"; do
echo "🌊 ktlint android $file"
ktlint --color --relative --editorconfig=example/android/.editorconfig $file
done
#echo "🌊 ktlint android $file"
ktlint --color --relative --editorconfig=example/android/.editorconfig "$@"
Empty file.

0 comments on commit b624561

Please sign in to comment.