mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
* fix: set up Ruby before linting in Github Actions * chore: separate linting from fixing Before we commit we want to fix as much as possible, but when we're checking a pull request we're not going to commit anything so we want to know about all the problems, including the fixable ones.
27 lines
849 B
Plaintext
Executable File
27 lines
849 B
Plaintext
Executable File
# If ggshield is installed, run it
|
|
if command -v ggshield &> /dev/null; then
|
|
ggshield secret scan pre-commit
|
|
# Otherwise require that inaturalist.org git users install it
|
|
elif git config --list | grep -q "user.email.*inaturalist.org"; then
|
|
echo
|
|
echo "Git users w/ inaturalist.org emails must install ggshield: https://docs.gitguardian.com/ggshield-docs/getting-started"
|
|
echo
|
|
exit 1
|
|
else
|
|
echo
|
|
echo "If you are iNat staff, you should install ggshield: https://docs.gitguardian.com/ggshield-docs/getting-started"
|
|
echo
|
|
fi
|
|
|
|
# Run lint and flow
|
|
npm run lint:fix
|
|
|
|
# Generate translations from strings.ftl
|
|
npm run translate
|
|
# ...and add them to the commit; this assumes src/i18n/l10n/ *only* contains
|
|
# files you want to add
|
|
git status --porcelain --untracked-files src/i18n/l10n/ \
|
|
| grep -v "D .*" \
|
|
| cut -c 4- \
|
|
| xargs git add
|