Skip to content

Commit

Permalink
Don't disable lint errors (actions#2436)
Browse files Browse the repository at this point in the history
* Update lint.yml

Don't ignore the formatting errors

* Add formatting made by @cory-miller

* Use dotnet format

* Format only modified files

* Add instruction to contribute.md

* Use git status instead of git diff
  • Loading branch information
JoannaaKL authored Feb 16, 2023
1 parent 982784d commit 02c9d1c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
uses: github/super-linter@v4
env:
DEFAULT_BRANCH: ${{ github.base_ref }}
DISABLE_ERRORS: true
EDITORCONFIG_FILE_NAME: .editorconfig
LINTER_RULES_PATH: /src/
VALIDATE_ALL_CODEBASE: false
Expand Down
8 changes: 8 additions & 0 deletions docs/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,11 @@ cat (Runner/Worker)_TIMESTAMP.log # view your log file

We use the .NET Foundation and CoreCLR style guidelines [located here](
https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md)

### Format C# Code

To format both staged and unstaged .cs files
```
cd ./src
./dev.(cmd|sh) format
```
11 changes: 10 additions & 1 deletion src/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ function runtest ()
dotnet msbuild -t:test -p:PackageRuntime="${RUNTIME_ID}" -p:BUILDCONFIG="${BUILD_CONFIG}" -p:RunnerVersion="${RUNNER_VERSION}" ./dir.proj || failed "failed tests"
}

function format()
{
heading "Formatting..."
files="$(git status -s "*.cs" | awk '{print $2}' | tr '\n' ' ')"
dotnet format ${SCRIPT_DIR}/ActionsRunner.sln --exclude / --include $files || failed "failed formatting"
}

function package ()
{
if [ ! -d "${LAYOUT_DIR}/bin" ]; then
Expand Down Expand Up @@ -360,7 +367,9 @@ case $DEV_CMD in
"l") layout;;
"package") package;;
"p") package;;
*) echo "Invalid cmd. Use build(b), test(t), layout(l) or package(p)";;
"format") format;;
"f") format;;
*) echo "Invalid cmd. Use build(b), test(t), layout(l), package(p), or format(f)";;
esac

popd
Expand Down

0 comments on commit 02c9d1c

Please sign in to comment.