mirror of
https://github.com/actions/runner.git
synced 2025-12-12 15:13:30 +00:00
Don't disable lint errors (#2436)
* 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
This commit is contained in:
1
.github/workflows/lint.yml
vendored
1
.github/workflows/lint.yml
vendored
@@ -18,7 +18,6 @@ jobs:
|
|||||||
uses: github/super-linter@v4
|
uses: github/super-linter@v4
|
||||||
env:
|
env:
|
||||||
DEFAULT_BRANCH: ${{ github.base_ref }}
|
DEFAULT_BRANCH: ${{ github.base_ref }}
|
||||||
DISABLE_ERRORS: true
|
|
||||||
EDITORCONFIG_FILE_NAME: .editorconfig
|
EDITORCONFIG_FILE_NAME: .editorconfig
|
||||||
LINTER_RULES_PATH: /src/
|
LINTER_RULES_PATH: /src/
|
||||||
VALIDATE_ALL_CODEBASE: false
|
VALIDATE_ALL_CODEBASE: false
|
||||||
|
|||||||
@@ -158,3 +158,11 @@ cat (Runner/Worker)_TIMESTAMP.log # view your log file
|
|||||||
|
|
||||||
We use the .NET Foundation and CoreCLR style guidelines [located here](
|
We use the .NET Foundation and CoreCLR style guidelines [located here](
|
||||||
https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md)
|
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
src/dev.sh
11
src/dev.sh
@@ -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"
|
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 ()
|
function package ()
|
||||||
{
|
{
|
||||||
if [ ! -d "${LAYOUT_DIR}/bin" ]; then
|
if [ ! -d "${LAYOUT_DIR}/bin" ]; then
|
||||||
@@ -360,7 +367,9 @@ case $DEV_CMD in
|
|||||||
"l") layout;;
|
"l") layout;;
|
||||||
"package") package;;
|
"package") package;;
|
||||||
"p") 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
|
esac
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|||||||
Reference in New Issue
Block a user