Skip to content

Commit

Permalink
Remove dotnet format (#194)
Browse files Browse the repository at this point in the history
* Revert "Add workflow_dispatch option to github actions (#192)"

This reverts commit fa5460b.

* Update common build folder

* Remove dotnet format
  • Loading branch information
emgarten authored Apr 20, 2024
1 parent fa5460b commit d935a05
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 69 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ on:
paths-ignore:
- 'doc/**'
- '*.md'
workflow_dispatch:
inputs:
branch:
description: 'Branch to run on'
required: true
default: 'main'

jobs:
build-linux:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/functional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ on:
paths-ignore:
- 'doc/**'
- '*.md'
workflow_dispatch:
inputs:
branch:
description: 'Branch to run on'
required: true
default: 'main'

jobs:
build-linux:
Expand Down
3 changes: 0 additions & 3 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ if ($AWSDefaultRegion) {
# Download tools
Install-CommonBuildTools $RepoRoot

# Run dotnet-format to apply style fixes or fail on CI builds
Invoke-DotnetFormat $RepoRoot

# Clean and write git info
Remove-Artifacts $RepoRoot
Invoke-DotnetMSBuild $RepoRoot ("build\build.proj", "/t:Clean;WriteGitInfo", "/p:Configuration=$Configuration")
Expand Down
42 changes: 0 additions & 42 deletions build/common/common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -126,53 +126,11 @@ Function Invoke-DotnetMSBuild {
Invoke-DotnetExe $RepoRoot $buildArgs
}

Function Install-DotnetTools {
param(
[string]$RepoRoot
)

$toolsPath = Join-Path $RepoRoot ".nuget/tools"

if (-not (Test-Path $toolsPath)) {
Write-Host "Installing dotnet tools to $toolsPath"
$args = @("tool","install","--tool-path",$toolsPath,"--ignore-failed-sources","dotnet-format","--version","5.1.250801")

Invoke-DotnetExe $RepoRoot $args
}
}

Function Install-CommonBuildTools {
param(
[string]$RepoRoot
)

Install-DotnetCLI $RepoRoot
Install-NuGetExe $RepoRoot
Install-DotnetTools $RepoRoot
}

Function Invoke-DotnetFormat {
param(
[string]$RepoRoot
)

# Only run in local dev envs
if ($env:CI -ne "True")
{
$formatExe = Join-Path $RepoRoot ".nuget/tools/dotnet-format.exe"

$args = @("--fix-whitespace", "--fix-style", "warn")

$command = "$formatExe $args"
Write-Host "[EXEC] $command" -ForegroundColor Cyan

& $formatExe $args

if (-not $?) {
Write-Warning "dotnet-format failed. Please fix the style errors!"

# Currently dotnet-format fails on CIs but not locally in some scenarios
# exit 1
}
}
}
12 changes: 0 additions & 12 deletions build/common/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ run_standard_tests()
# Download dotnet cli
REPO_ROOT=$(pwd)
DOTNET=$(pwd)/.cli/dotnet
DOTNET_TOOLS=$(pwd)/.nuget/tools
DOTNET_FORMAT=$DOTNET_TOOLS/dotnet-format

if [ ! -f $DOTNET ]; then
echo "Installing dotnet"
Expand All @@ -24,16 +22,6 @@ run_standard_tests()
# Display info
$DOTNET --info

# install dotnet-format
if [ ! -d $DOTNET_TOOLS ]; then
echo "Installing dotnet tools"
mkdir -p .nuget/tools

$DOTNET tool install --tool-path $DOTNET_TOOLS --ignore-failed-sources dotnet-format --version 5.1.250801
fi

$DOTNET_FORMAT --fix-whitespace --fix-style warn

# clean
rm -r -f $(pwd)/artifacts

Expand Down

0 comments on commit d935a05

Please sign in to comment.