Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ValidatePullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ jobs:
--logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true"
--
RunConfiguration.CollectSourceInformation=true
no_warnings:
runs-on: ubuntu-latest
name: No Warnings
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v3
- run: >
dotnet build CSharpier.slnx -c release -p:TreatWarningsAsErrors=true
builds_playground:
runs-on: ubuntu-latest
name: Builds Playground
Expand Down
13 changes: 4 additions & 9 deletions .run/Debug msbuild.run.xml → .run/Debug CLI.run.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
<component name="ProjectRunConfigurationManager">
<configuration
default="false"
name="Debug msbuild"
type="DotNetProject"
factoryName=".NET Project"
>
<configuration default="false" name="Debug CLI" type="DotNetProject" factoryName=".NET Project">
<option
name="EXE_PATH"
value="$PROJECT_DIR$/Src/CSharpier.Cli/bin/Debug/net8.0/CSharpier.exe"
value="$PROJECT_DIR$/Src/CSharpier.Cli/bin/Debug/net8.0/CSharpier.dll"
/>
<option
name="PROGRAM_PARAMETERS"
value="check C:\projects\csharpier-msbuild --log-format MsBuild"
value="format C:\projects\csharpier-repos\mono\mcs\class\System.XML\Test\System.Xml\nist_dom\files\staff.xml"
/>
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Src/CSharpier.Cli/bin/Debug/net8.0" />
<option name="PASS_PARENT_ENVS" value="1" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="ENV_FILE_PATHS" value="" />
<option name="REDIRECT_INPUT_PATH" value="" />
<option name="PTY_MODE" value="Auto" />
<option name="MIXED_MODE_DEBUG" value="0" />
<option name="USE_MONO" value="0" />
<option name="RUNTIME_ARGUMENTS" value="" />
<option name="AUTO_ATTACH_CHILDREN" value="0" />
<option name="MIXED_MODE_DEBUG" value="0" />
<option name="PROJECT_PATH" value="$PROJECT_DIR$/Src/CSharpier.Cli/CSharpier.Cli.csproj" />
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
Expand Down
3 changes: 2 additions & 1 deletion .run/Playground.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
name="LAUNCH_PROFILE_PROJECT_FILE_PATH"
value="$PROJECT_DIR$/Src/CSharpier.Playground/CSharpier.Playground.csproj"
/>
<option name="LAUNCH_PROFILE_TFM" value="net9.0" />
<option name="LAUNCH_PROFILE_TFM" value="net10.0" />
<option name="LAUNCH_PROFILE_NAME" value="Watch" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
Expand All @@ -18,6 +18,7 @@
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0" />
<option name="SEND_DEBUG_REQUEST" value="1" />
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value="" />
<option name="AUTO_ATTACH_CHILDREN" value="0" />
<method v="2">
<option name="Build" />
</method>
Expand Down
1 change: 0 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<Nullable>enable</Nullable>
<!-- this is the warning generators get when they fail to generate a source file this makes sure the error for it failing is obvious -->
<WarningsAsErrors>CS8032;CS8033;</WarningsAsErrors>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<AnalysisMode>Recommended</AnalysisMode>
Expand Down
10 changes: 7 additions & 3 deletions Shell/BuildProject.psm1
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
function CSH-BuildProject
{
function CSH-BuildProject {
param (
[switch]$doNotExit = $false
)


$repositoryRoot = Join-Path $PSScriptRoot ".."
$csProjectPath = Join-Path $repositoryRoot "Src/CSharpier.Cli/CSharpier.Cli.csproj"

& dotnet build $csProjectPath -c release
if ($lastExitCode -gt 0) {
if ($lastExitCode -gt 0 -and -not $doNotExit) {
exit $lastExitCode;
}
}
Expand Down
24 changes: 14 additions & 10 deletions Shell/ReviewBranch.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ function CSH-ReviewBranch {
param (
[string]$folder,
[string]$pathToTestingRepo,
[switch]$skipValidation = $true
[switch]$skipValidation = $true,
[switch]$onlyXml = $false
)

$repositoryRoot = Join-Path $PSScriptRoot ".."
Expand Down Expand Up @@ -60,22 +61,25 @@ function CSH-ReviewBranch {

if ($firstRun) {
Set-Location $repositoryRoot
# try {
& git checkout main #2>&1 | Out-String
# }
# catch {
# Write-Host "Could not checkout main on csharpier, working directory is probably not clean"
# return
# }

CSH-BuildProject

& git checkout main #2>&1 | Out-String

CSH-BuildProject -doNotExit

if ($lastExitCode -gt 0) {
return
}

Set-Location $pathToTestingRepo

& git checkout main
& git reset --hard
& git checkout -b $preBranch

if ($onlyXml) {
Add-Content -Path "$pathToTestingRepo/.csharpierignore" -Value "**/*.cs"
}

dotnet $csharpierDllPath format . $skipValidationParam --no-cache
# there is some weirdness with a couple files with #if where
# they need to be formatted twice to get them stable
Expand Down
Loading
Loading