Skip to content

Commit cf9d28a

Browse files
yungstersfacebook-github-bot
authored andcommitted
RN: Improve lint-ci Script (#51853)
Summary: Pull Request resolved: #51853 While testing D75988059 with D76047973, I noticed a few opportunities to improve the script used by `yarn lint-ci`: - The exit code does not currently propagate, meaning `lint-ci` will succeed when it shouldn't. - The shell script uses some non-idiomatic practices, so this improves it. Changelog: [Internal] Reviewed By: kassens, cipolleschi Differential Revision: D76049502 fbshipit-source-id: ebefddf0909edc89cd97de756b93bfaaa3d7cdef
1 parent 8db1222 commit cf9d28a

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflow-scripts/analyze_code.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,24 @@
44
# This source code is licensed under the MIT license found in the
55
# LICENSE file in the root directory of this source tree.
66

7-
GITHUB_OWNER=-facebook
8-
GITHUB_REPO=-react-native
9-
export GITHUB_OWNER
10-
export GITHUB_REPO
7+
export GITHUB_OWNER=-facebook
8+
export GITHUB_REPO=-react-native
119

12-
cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow-check --silent --json; echo google-java-format; node scripts/lint-java.js --diff) | node packages/react-native-bots/code-analysis-bot.js
10+
{
11+
echo eslint
12+
npm run lint --silent -- --format=json
13+
14+
echo flow
15+
npm run flow-check --silent --json
16+
17+
echo google-java-format
18+
node scripts/lint-java.js --diff
19+
} | node packages/react-native-bots/code-analysis-bot.js
1320

1421
STATUS=$?
1522
if [ $STATUS == 0 ]; then
1623
echo "Code analyzed successfully."
1724
else
1825
echo "Code analysis failed, error status $STATUS."
1926
fi
27+
exit $STATUS

0 commit comments

Comments
 (0)