Skip to content

Commit

Permalink
Merge branch 'main' into suppress-warning-CS1591
Browse files Browse the repository at this point in the history
  • Loading branch information
VaclavSir authored Dec 13, 2023
2 parents a8315b7 + d72ad9d commit 3a97624
Show file tree
Hide file tree
Showing 1,510 changed files with 25,327 additions and 24,037 deletions.
31 changes: 31 additions & 0 deletions .build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Linq;
using System;
using System.IO;
using Serilog;

[UnsetVisualStudioEnvironmentVariables]
partial class Build : NukeBuild
Expand Down Expand Up @@ -100,6 +101,36 @@ partial class Build : NukeBuild
RootDirectory / "matrix.json",
JsonConvert.SerializeObject(matrix));
});

Target Accept => _ => _
.Executes(() =>
{
foreach (var mismatchDir in Directory.GetDirectories(
RootDirectory, "__MISMATCH__", SearchOption.AllDirectories))
{
Log.Information("Analyzing {0} ...", mismatchDir);
var snapshotDir = Directory.GetParent(mismatchDir)!.FullName;
foreach (var mismatch in Directory.GetFiles(
mismatchDir, "*.*", SearchOption.TopDirectoryOnly))
{
var snapshot = Path.Combine(snapshotDir, Path.GetFileName(mismatch));
if (File.Exists(snapshot))
{
File.Delete(snapshot);
File.Move(mismatch, snapshot);
}
}
foreach (var mismatch in Directory.GetFiles(
mismatchDir, "*.*", SearchOption.AllDirectories))
{
File.Delete(mismatch);
}
Directory.Delete(mismatchDir, true);
}
});
}


Expand Down
6 changes: 6 additions & 0 deletions accept.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:; set -eo pipefail
:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
:; ${SCRIPT_DIR}/accept.sh "$@"
:; exit $?

./build.cmd accept
44 changes: 1 addition & 43 deletions accept.sh
Original file line number Diff line number Diff line change
@@ -1,45 +1,3 @@
#!/bin/zsh

# Use a variable to keep track of whether any directories were found
found_mismatch=false

# Use a variable to check if the header has been printed
header_printed=false

# Find all __MISMATCH__ folders
find . -type d -name "__MISMATCH__" | while read mismatch_dir; do
# Mark that we found a mismatch directory
found_mismatch=true

# Get the parent __snapshots__ directory
snapshot_dir="$(dirname "$mismatch_dir")"

# If there are files in the directory, copy them
if [ "$(ls -A "$mismatch_dir")" ]; then
for file in "$mismatch_dir"/*; do
if [ -f "$file" ]; then
cp "$file" "$snapshot_dir/"

# Print the header only once
if [ "$header_printed" = false ]; then
echo "Found Updated Snapshots:"
header_printed=true
fi

# Extract relevant path details and print
relative_path="${snapshot_dir#./src/HotChocolate/}" # strip the common prefix
echo "- $relative_path/$(basename "$file")"
fi
done
fi

# Remove the __MISMATCH__ directory
rm -r "$mismatch_dir"
done

# Check if any directories were found
if [ "$found_mismatch" = false ]; then
echo "All snapshots are up to date!"
else
echo "\nDone!"
fi
./build.sh accept
1 change: 1 addition & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"traversion",
"Websockets",
"Newtonsoft",
"supergraph",
"cachable",
"fricking",
"runtimes",
Expand Down
3 changes: 2 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"sdk": {
"version": "8.0.100-rc.2.23502.2"
"version": "8.0.100",
"rollForward": "latestMinor"
}
}
2 changes: 1 addition & 1 deletion src/CookieCrumble/src/CookieCrumble/CookieCrumble.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.0-rc.2.23480.2" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
Expand Down
2 changes: 1 addition & 1 deletion src/CookieCrumble/src/CookieCrumble/LocalFactDiscoverer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace CookieCrumble;

[XunitTestCaseDiscoverer("LocalFactDiscoverer", "YourTestAssemblyName")]
public class LocalFactAttribute : FactAttribute { }
public class LocalFactAttribute : FactAttribute;

public class LocalFactDiscoverer : FactDiscoverer
{
Expand Down
Loading

0 comments on commit 3a97624

Please sign in to comment.