Skip to content

Commit

Permalink
chore: Ignore comments in validation scripts (#6554)
Browse files Browse the repository at this point in the history
🚀

Also fixing unescaped double quotes.

Adding @jfedak as reviewer because GitHub suggested him 🤷
  • Loading branch information
tjzel authored Oct 3, 2024
1 parent 0aa5014 commit 18a6355
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/react-native-reanimated/scripts/validate-android.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

if grep -Rn android/src/main/cpp -e '#include "' ; then
echo "Found \`#include "..."\` in \`android/src/main/cpp/\` directory. Convert it to \`#include <...>\`, e.g. \`#include <reanimated/AndroidUIScheduler.h>\`." && false
if grep -Rn android/src/main/cpp -e '^#include "'; then
echo 'Found `#include "..."` in `android/src/main/cpp/` directory. Convert it to `#include <...>`, e.g. `#include <reanimated/AndroidUIScheduler.h>`.' && false
fi
12 changes: 6 additions & 6 deletions packages/react-native-reanimated/scripts/validate-apple.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash

if grep -Rn apple -e '#include ' ; then
echo "Found \`#include\` in \`apple/\` directory. Convert it to \`#import\`, e.g. \`#import <reanimated/apple/REAModule.h>\`." && false
if grep -Rn apple -e '^#include '; then
echo 'Found `#include` in `apple/` directory. Convert it to `#import`, e.g. `#import <reanimated/apple/REAModule.h>`.' && false
fi

if grep -Rn apple -e '#import "' ; then
echo "Found \`#import "..."\` in \`apple/\` directory. Convert it to \`#import <...>\`, e.g. \`#import <reanimated/apple/REAModule.h>\`." && false
if grep -Rn apple -e '^#import "'; then
echo 'Found `#import "..."` in `apple/` directory. Convert it to `#import <...>`, e.g. `#import <reanimated/apple/REAModule.h>`.' && false
fi

if grep -Rn apple -e '<RNReanimated/' ; then
echo "Found \`#import <RNReanimated/...>\` in \`apple/\` directory. Convert it to \`#import <reanimated/...>\`, e.g. \`#import <reanimated/apple/REAModule.h>\`." && false
if grep -Rn apple -e '^#import <RNReanimated/'; then
echo 'Found `#import <RNReanimated/...>` in `apple/` directory. Convert it to `#import <reanimated/...>`, e.g. `#import <reanimated/apple/REAModule.h>`.' && false
fi
8 changes: 4 additions & 4 deletions packages/react-native-reanimated/scripts/validate-common.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash

if grep -Rn Common/cpp -e '#include "' ; then
echo "Found \`#include "..."\` in \`Common/cpp/\` directory. Convert it to \`#include <...>\`, e.g. \`#include <reanimated/Fabric/PropsRegistry.h>\`." && false
if grep -Rn Common/cpp -e '^#include "'; then
echo 'Found `#include "..."` in `Common/cpp/` directory. Convert it to `#include <...>`, e.g. `#include <reanimated/Fabric/PropsRegistry.h>`.' && false
fi

if grep -Rn Common/cpp/worklets -e '#include <reanimated/' ; then
echo "Found \`#include <reanimated/...>\` in \`Common/cpp/worklets/'\` directory which is not allowed." && false
if grep -Rn Common/cpp/worklets -e '^#include <reanimated/'; then
echo 'Found `#include <reanimated/...>` in `Common/cpp/worklets/` directory which is not allowed.' && false
fi

0 comments on commit 18a6355

Please sign in to comment.