Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Android/device/device/google/trout/tools/   (Android Betriebssystem Version 17©)  Datei vom 26.5.2026 mit Größe 1 kB image not shown  

Quelle  pre-commit

  Sprache: JAVA
 

#!/bin/bash
# Owner: gchips-productivity-team@google.com
# VERSION: 2019-12-16
# Pre commit hook to auto format code using git clang-format

# change the default style to Google
git config --global clangformat.style Google

# default PRE_COMMIT_CLANG_FORMAT to true
PRE_COMMIT_CLANG_FORMAT="${PRE_COMMIT_CLANG_FORMAT:-true}"

check_clang_format() {
  if ! [ -x "$(command -v clang-format)" ]; then
    echo "Warning: clang-format not found.  Unable to format source code before commit. Please check go/clang-format-setup for setup instructions."
  fi
}

if [ "$PRE_COMMIT_CLANG_FORMAT" = true ] ; then
  check_clang_format
  FILES=$(git clang-format)
  counter=0
  for file in $FILES ; do
    if [[ -f "$file" ]]; then
      git add ${file}
      echo -e "[Info] Changes in ${file} have been formatted"
      ((counter++))
    fi
  done

  if ((  counter > 0 )); then
    echo "[Info] $counter file(s) have been formatted"
    # Track Usage
    MY_PATH=${PWD//\//"%2F"}
    curl "https://us-central1-si-sw-eng-prod-team.cloudfunctions.net/trackAutoFormatUsage?user=${USER}&pwd=${MY_PATH}×tamp=$(date +%s)&type=FORMAT&filesFormatted=${counter}" > /dev/null 2>&le='color: green'>1
  fi

fi

# Run google's default pre-commit
if [ -x /usr/lib/git-core/google_hook ]; then
  /usr/lib/git-core/google_hook pre-commit "$@"
else
  echo 'warning: Cannot run /usr/lib/git-core/google_hook.' \
    'If this is unexpected, please file a go/git-bug' >&2
fi

Messung V0.5 in Prozent
C=63 H=93 G=79

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-06-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.