forked from git/git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add usage-strings ci check and amend remaining usage strings
Usage strings for git (sub)command flags has a style guide that suggests - first letter should not capitalized (unless requied) and it should skip full-stop at the end of line. But there are some files where usage-strings do not follow the above mentioned guide. Moreover, there are no checks to verify if all usage strings are following the guide/convention or not. Amend the usage strings that don't follow the convention/guide and add a `CI` check for checking the usage strings (whether the first letter is capital or it ends with full-stop). If the `check` find such strings then print those strings and return a non-zero status. Also provide a script that takes an optional argument (a valid <tree> string), to check the usage strings in the given <tree> (`HEAD` is the default argument). Signed-off-by: Abhradeep Chakraborty <chakrabortyabhradeep79@gmail.com>
- Loading branch information
Showing
7 changed files
with
45 additions
and
6 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
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,33 @@ | ||
{ | ||
if test -d ".git" | ||
then | ||
rev=${1:-"HEAD"} | ||
for entry in $(git grep -l 'struct option .* = {$' "$rev" -- \*.c); | ||
do | ||
git show "$entry" | | ||
sed -n '/struct option .* = {/,/OPT_END/{=;p;}' | | ||
sed "N;s/^\\([0-9]*\\)\\n/$(echo "$entry" | sed 's/\//\\&/g'):\\1/"; | ||
done | ||
else | ||
for entry in $(grep -rl --include="*.c" 'struct option .* = {$' . ); | ||
do | ||
cat "$entry" | | ||
sed -n '/struct option .* = {/,/OPT_END/{=;p;}' | | ||
sed "N;s/^\\([0-9]*\\)\\n/$(echo "$entry" | sed -e 's/\//\\&/g' -e 's/^\.\\\///'):\\1/"; | ||
done | ||
fi | ||
} | | ||
grep -Pe '((?<!OPT_GROUP\(N_\(|OPT_GROUP\()"(?!GPG|DEPRECATED|SHA1|HEAD)[A-Z]|(?<!"|\.\.)\.")' | | ||
{ | ||
status=0 | ||
while read content; | ||
do | ||
if test -n "$content" | ||
then | ||
echo "$content"; | ||
status=1; | ||
fi | ||
done | ||
|
||
exit $status | ||
} |
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