From 18a6355cb4fb596fa46bb36496e74ea93d75c9f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= <40713406+tjzel@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:46:47 +0200 Subject: [PATCH] chore: Ignore comments in validation scripts (#6554) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🚀 Also fixing unescaped double quotes. Adding @jfedak as reviewer because GitHub suggested him 🤷 --- .../scripts/validate-android.sh | 4 ++-- .../scripts/validate-apple.sh | 12 ++++++------ .../scripts/validate-common.sh | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/react-native-reanimated/scripts/validate-android.sh b/packages/react-native-reanimated/scripts/validate-android.sh index 9bc759a0f25..47b6b49b5c3 100755 --- a/packages/react-native-reanimated/scripts/validate-android.sh +++ b/packages/react-native-reanimated/scripts/validate-android.sh @@ -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 \`." && 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 `.' && false fi diff --git a/packages/react-native-reanimated/scripts/validate-apple.sh b/packages/react-native-reanimated/scripts/validate-apple.sh index 68ffe3f6b6c..2a6c08a72c9 100755 --- a/packages/react-native-reanimated/scripts/validate-apple.sh +++ b/packages/react-native-reanimated/scripts/validate-apple.sh @@ -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 \`." && false +if grep -Rn apple -e '^#include '; then + echo 'Found `#include` in `apple/` directory. Convert it to `#import`, e.g. `#import `.' && false fi -if grep -Rn apple -e '#import "' ; then - echo "Found \`#import "..."\` in \`apple/\` directory. Convert it to \`#import <...>\`, e.g. \`#import \`." && false +if grep -Rn apple -e '^#import "'; then + echo 'Found `#import "..."` in `apple/` directory. Convert it to `#import <...>`, e.g. `#import `.' && false fi -if grep -Rn apple -e '\` in \`apple/\` directory. Convert it to \`#import \`, e.g. \`#import \`." && false +if grep -Rn apple -e '^#import ` in `apple/` directory. Convert it to `#import `, e.g. `#import `.' && false fi diff --git a/packages/react-native-reanimated/scripts/validate-common.sh b/packages/react-native-reanimated/scripts/validate-common.sh index 091ebda27ff..228ba9ad1c3 100755 --- a/packages/react-native-reanimated/scripts/validate-common.sh +++ b/packages/react-native-reanimated/scripts/validate-common.sh @@ -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 \`." && false +if grep -Rn Common/cpp -e '^#include "'; then + echo 'Found `#include "..."` in `Common/cpp/` directory. Convert it to `#include <...>`, e.g. `#include `.' && false fi -if grep -Rn Common/cpp/worklets -e '#include \` in \`Common/cpp/worklets/'\` directory which is not allowed." && false +if grep -Rn Common/cpp/worklets -e '^#include ` in `Common/cpp/worklets/` directory which is not allowed.' && false fi