Skip to content

Commit

Permalink
change linter to be executed from bash
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-erojaslizano committed Mar 21, 2024
1 parent 8706d37 commit 3d869bf
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
Binary file modified .DS_Store
Binary file not shown.
9 changes: 2 additions & 7 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,5 @@ jobs:
with:
dotnet-version: "6.0.x"
- name: Run linters
uses: wearerequired/lint-action@v2
with:
dotnet_format: true
continue_on_error: false
github_token: ${{ secrets.GITHUB_TOKEN }}
check_name: ${linter} run
auto_fix: true
shell: bash
run: ./ci/linter.sh
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,6 @@ whitesource/
Snowflake.Data.Tests/macos_*_performance.csv
Snowflake.Data.Tests/windows_*_performance.csv
Snowflake.Data.Tests/unix_*_performance.csv

# MacOs only files
**/.DS_Store
27 changes: 27 additions & 0 deletions ci/linter.sh
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

0 comments on commit 3d869bf

Please sign in to comment.