Skip to content

Commit 1952656

Browse files
committed
Change validate-formatting.sh so that it ignores pubspec.lock
Pubspec.lock can be modified in a number of way during CI/CD processes, and we don’t need to check its formatting.
1 parent 9f13686 commit 1952656

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/scripts/validate-formatting.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
# limitations under the License.
1515
set -e
1616

17-
if [[ $(git ls-files --modified) ]]; then
17+
# Get modified files, excluding pubspec.lock.
18+
# The '|| true' prevents the script from exiting if grep finds no matches.
19+
MODIFIED_FILES=$(git ls-files --modified | grep -v '^pubspec.lock$' || true)
20+
21+
if [[ $MODIFIED_FILES ]]; then
1822
echo ""
1923
echo ""
2024
echo "These files are not formatted correctly:"

0 commit comments

Comments
 (0)