瀏覽代碼

Fix typo and remove code hook for l10n

Neeraj Gupta 2 年之前
父節點
當前提交
0a3a24d668
共有 2 個文件被更改,包括 2 次插入32 次删除
  1. 1 29
      hooks/pre-commit
  2. 1 3
      hooks/pre-commit-fdroid

+ 1 - 29
hooks/pre-commit

@@ -1,37 +1,9 @@
 #!/bin/sh
 # This git hook fails if a user is trying to add a new file which is
 # not null safe.
+exec ./hooks/pre-commit-fdroid
 
-# Check the contents of each file that is being added(A) or modified(N) or
-# copied (C)
-for file in `git diff --name-only --diff-filter=ACM --cached`; do
-  # Ignore the hooks from any pre-commit check
-  if echo "$file" | grep -q 'hooks/'; then
-    continue
-  fi
-  # Get the contents of the newly added lines in the file
-  newContent=`git diff --cached --unified=0 $file | grep '^+'`
-  oldContent=`git diff --cached --unified=0 $file | grep '^-'`
-  initialContent=`head -5 $file`
 
-  # Check if user has added "// @dart=2.9" in the file
-  if echo "$newContent" | grep -q '// @dart=2.9'; then
-    echo "😡 File $file looks like a newly created file but it's not null-safe"
-    exit 1
-  elif echo "$oldContent" | grep -q '// @dart=2.9'; then
-    echo "💚💚 Thank you for making $file null-safe"
-    continue
-  elif echo "$initialContent" | grep -q '// @dart=2.9'; then
-    echo "🔥🔥🔥🔥 Please make $file null-safe"
-    continue
-  else
-    continue
-  fi
-done
-
-nullUnsafeFiles=$(grep  '// @dart=2.9' -r lib/ | wc -l)
-# The xargs at the end is to trim whitepsaces https://stackoverflow.com/a/12973694/546896
-echo "🥺🥺 $nullUnsafeFiles files are still waiting for their nullSafety migrator" | xargs
 
 # If the script gets to this point, all files passed the check
 exit 0

+ 1 - 3
hooks/pre-commit-fdroid

@@ -1,11 +1,9 @@
 #!/bin/sh
-
 # Get the current branch
 current_branch=$(git rev-parse --abbrev-ref HEAD)
 
-# If the current branch is f-droid, echo Hello World
 if [ "$current_branch" = "f-droid" ]; then
-    # Verify that the pubspec.yaml doesn't contain certain words
+    # Verify that the pubspec.yaml doesn't contain certain dependencies
     WORDS=("in_app_purchase" "firebase")
     for word in ${WORDS[@]}; do
         if grep -q $word pubspec.yaml; then