File: git-cl.sh

package info (click to toggle)
opentelemetry-cpp 1.23.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,368 kB
  • sloc: cpp: 96,239; sh: 1,766; makefile: 38; python: 31
file content (20 lines) | stat: -rwxr-xr-x 348 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
set -e

if [ "format" = "$1" ]; then
  if [ -z "$2" ]; then
    echo Please specify file name.
    exit
  fi

  if [ -f "$2" ]; then
    FILEPATH=$2
  else
    FILEPATH=${GIT_PREFIX}$2
  fi
  echo Formatting $FILEPATH
  clang-format -style=file -i $FILEPATH
fi