-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change linter to be executed from bash
- Loading branch information
1 parent
8706d37
commit 3d869bf
Showing
4 changed files
with
32 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# Ensure the script stops if there's an error | ||
set -e | ||
|
||
# Fetch latest commits and branches from origin to ensure the comparison is up-to-date | ||
git fetch origin master | ||
|
||
# List files that have been modified in the current branch compared to master | ||
# This filters for files ending in .cs (C# files) | ||
modified_files=$(git diff --name-only origin/master...HEAD | grep '\.cs$') | ||
|
||
# Check if modified_files is empty | ||
if [ -z "$modified_files" ]; then | ||
echo "No C# files have been modified." | ||
else | ||
echo "Modified C# files:" | ||
echo "$modified_files" | ||
|
||
# Run dotnet format on each modified file | ||
for file in $modified_files; do | ||
echo "Formatting $file" | ||
dotnet format "$file" --check --verbosity diagnostic | ||
done | ||
|
||
echo "Formatting complete." | ||
fi |