Skip to content

Commit

Permalink
Merge branch 'master' into added-code-format
Browse files Browse the repository at this point in the history
  • Loading branch information
scarlac authored Apr 30, 2024
2 parents 89420f9 + 6c5ae90 commit 4249b37
Show file tree
Hide file tree
Showing 23 changed files with 498 additions and 141 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: Build
run-name: ⚙️ Build examples on ${{ github.event_name == 'pull_request' && 'PR' || '🌱' }} ${{ github.event_name == 'pull_request' && github.event.number || github.ref_name }}

on:
pull_request:
types: [opened, reopened]
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
build-example-ios:
name: build-example-ios
Expand Down
35 changes: 33 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: Linter
run-name: 🩺 Code checks on ${{ github.event_name == 'pull_request' && 'PR' || '🌱' }} ${{ github.event_name == 'pull_request' && github.event.number || github.ref_name }}

on:
pull_request:
types: [opened, reopened]
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
eslint:
name: ESLint
Expand All @@ -16,3 +21,29 @@ jobs:
run: yarn bootstrap-linux
- name: Lint
run: yarn lint

ios:
name: Lint iOS
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: brew bundle
- name: Run swiftlint
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
updatedFiles=$(git --no-pager diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} -- '*.swift')
if [[ -z "$updatedFiles" ]]; then
echo "No Swift files changed, skipping linting"
exit 0
fi
swiftlint --reporter github-actions-logging -- $updatedFiles
else
swiftlint
fi
21 changes: 21 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
included:
- ios
- example/ios

excluded:
- ios/Pods
- example/ios/Pods

disabled_rules:
- todo

line_length: 160
type_body_length: 400
function_body_length: 50

identifier_name:
excluded:
- on
- x
- y
- at
2 changes: 2 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
brew 'swiftlint'

62 changes: 62 additions & 0 deletions Brewfile.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"entries": {
"brew": {
"swiftlint": {
"version": "0.53.0",
"bottle": {
"rebuild": 0,
"root_url": "https://ghcr.io/v2/homebrew/core",
"files": {
"arm64_sonoma": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:240ccda9de55d948d0c635798079074099bfcb73ffda41428900fdc748aeea7b",
"sha256": "240ccda9de55d948d0c635798079074099bfcb73ffda41428900fdc748aeea7b"
},
"arm64_ventura": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:7b7ceb7896c6833965cc4eac9001255d8adde6c5432045d5a8ab6aea8a9e81d9",
"sha256": "7b7ceb7896c6833965cc4eac9001255d8adde6c5432045d5a8ab6aea8a9e81d9"
},
"arm64_monterey": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:78c2a4c3f4a2f6847b484527b0f0f916da71e3ee29e49890fd44b63fe7b38e26",
"sha256": "78c2a4c3f4a2f6847b484527b0f0f916da71e3ee29e49890fd44b63fe7b38e26"
},
"sonoma": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:abdca78dd8a8bd268053b3be195fe891bb74aef5502ab3a6b871ae0c6bb04540",
"sha256": "abdca78dd8a8bd268053b3be195fe891bb74aef5502ab3a6b871ae0c6bb04540"
},
"ventura": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:be711c707bf3b49fa0dd6e2ae576b309aad620f9b56a2c6e7b1ac5cf35cf652a",
"sha256": "be711c707bf3b49fa0dd6e2ae576b309aad620f9b56a2c6e7b1ac5cf35cf652a"
},
"monterey": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:13487d68a971dbe035019364e19d70641af2a18c06e52925d238685b384a7979",
"sha256": "13487d68a971dbe035019364e19d70641af2a18c06e52925d238685b384a7979"
},
"x86_64_linux": {
"cellar": "/home/linuxbrew/.linuxbrew/Cellar",
"url": "https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:fbbc56fccfcfcd34564feb7325567e2ff3638d3c609396a5c4aa13311c7b26e0",
"sha256": "fbbc56fccfcfcd34564feb7325567e2ff3638d3c609396a5c4aa13311c7b26e0"
}
}
}
}
}
},
"system": {
"macos": {
"sonoma": {
"HOMEBREW_VERSION": "4.2.0-54-g0b804d4",
"HOMEBREW_PREFIX": "/opt/homebrew",
"Homebrew/homebrew-core": "api",
"CLT": "15.1.0.0.1.1700200546",
"Xcode": "15.0",
"macOS": "14.1"
}
}
}
}
3 changes: 2 additions & 1 deletion android/src/main/java/com/rncamerakit/CKCameraManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class CKCameraManager : SimpleViewManager<CKCamera>() {
"onOrientationChange", MapBuilder.of("registrationName", "onOrientationChange"),
"onReadCode", MapBuilder.of("registrationName", "onReadCode"),
"onPictureTaken", MapBuilder.of("registrationName", "onPictureTaken"),
"onZoom", MapBuilder.of("registrationName", "onZoom")
"onZoom", MapBuilder.of("registrationName", "onZoom"),
"onError", MapBuilder.of("registrationName", "onError")
)
}

Expand Down
17 changes: 14 additions & 3 deletions example/src/BarcodeScreenExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,17 @@ const BarcodeExample = ({ onBack }: { onBack: () => void }) => {
<SafeAreaView style={styles.topButtons}>
{flashData.image && (
<TouchableOpacity style={styles.topButton} onPress={onSetFlash}>
<Image source={flashData.image} resizeMode="contain" />
<Image style={styles.topButtonImg} source={flashData.image} resizeMode="contain" />
</TouchableOpacity>
)}

<TouchableOpacity style={styles.topButton} onPress={onSwitchCameraPressed}>
<Image source={require('../images/cameraFlipIcon.png')} resizeMode="contain" />
<Image style={styles.topButtonImg} source={require('../images/cameraFlipIcon.png')} resizeMode="contain" />
</TouchableOpacity>

<TouchableOpacity style={styles.topButton} onPress={onSetTorch}>
<Image
style={styles.topButtonImg}
source={torchMode ? require('../images/torchOn.png') : require('../images/torchOff.png')}
resizeMode="contain"
/>
Expand Down Expand Up @@ -201,7 +202,17 @@ const styles = StyleSheet.create({
justifyContent: 'space-between',
},
topButton: {
padding: 10,
backgroundColor: '#222',
width: 44,
height: 44,
borderRadius: 22,
justifyContent: 'center',
alignItems: 'center',
},
topButtonImg: {
margin: 10,
width: 24,
height: 24,
},

cameraContainer: {
Expand Down
Loading

0 comments on commit 4249b37

Please sign in to comment.