forked from digitalocean/prometheus-client-c
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates * Adding .clang-format to keep formatting consistent * Adding regression test for prom_histogram_buckets * Added format command to auto * Formatted project Co-authored-by: Demitri Swan <[email protected]>
- Loading branch information
Showing
90 changed files
with
1,099 additions
and
1,356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
BasedOnStyle: Google | ||
ColumnLimit: 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ ttyrecord | |
_CPack_Packages/ | ||
*deb | ||
*tar.gz | ||
*vgcore* | ||
*vgcore* | ||
*.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/usr/bin/env bash | ||
|
||
######################################################################################################################## | ||
# Meta | ||
######################################################################################################################## | ||
|
||
# Propagate environment variables | ||
if [[ "$AUTO_DEBUG" == "1" ]]; then | ||
set -x | ||
export AUTO_DEBUG=1 | ||
fi | ||
|
||
PROGRAM_NAME=$(basename $0) | ||
|
||
short="Format the project" | ||
read -d '' long <<EOF | ||
You SHOULD execute this command within the development container. | ||
EOF | ||
|
||
usage(){ | ||
cat <<EOF | ||
$PROGRAM_NAME [-h] | ||
$short | ||
EOF | ||
} | ||
|
||
######################################################################################################################## | ||
# End Meta | ||
######################################################################################################################## | ||
|
||
source "$(dirname ${BASH_SOURCE[0]})/../autolib.sh" | ||
|
||
main(){ | ||
declare -i return_value=0 | ||
|
||
while getopts "h" opt; do | ||
case $opt in | ||
( h ) { | ||
usage && exit 0 | ||
} ;; | ||
esac | ||
done | ||
|
||
while read file_path; do | ||
local temp | ||
temp=$(mktemp) || { | ||
return_value=$? | ||
autolib_output_error "failed to create temp file" | ||
exit $return_code | ||
} | ||
|
||
{ | ||
clang-format --style=file $file_path > $temp && | ||
sed -i 's/Copyright 2019-2020/Copyright 2019-2020/g' $temp && | ||
mv $temp $file_path | ||
} || { | ||
return_value=$? | ||
autolib_output_error "failed to format project" | ||
exit $return_code | ||
} | ||
done < <(find ${PWD} -regextype posix-extended -type f -regex ".*/prom[[:alnum:]_-]+\.[c|h]" ! -regex '.*CPack.*') || { | ||
return_value=$? | ||
autolib_output_error "failed to find relevant C project files" | ||
exit $return_code | ||
} | ||
} | ||
|
||
[[ $BASH_SOURCE == $0 ]] && main $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.