Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Xtro] If the sanitizer removed all selectors, remove the file. #12256

Merged

Conversation

mandel-macaque
Copy link
Member

A new check was added to ensure that empty .todo files are not added,
yet when the sanitizer removes all lines we get an error per empty file.

Since we are auto-sanitizing, we want to remove those empty files.

A new check was added to ensure that empty .todo files are not added,
yet when the sanitizer removes all lines we get an error per empty file.

Since we are auto-sanitizing, we want to remove those empty files.
@mandel-macaque mandel-macaque added the not-notes-worthy Ignore for release notes label Jul 27, 2021
@mandel-macaque mandel-macaque requested a review from spouliot as a code owner July 27, 2021 17:17
@@ -177,6 +177,10 @@ static void NoFixedTodo ()
foreach (var failure in failures)
sanitized.Remove (failure);
File.WriteAllLines (file, sanitized);
// since we are in AUTO_SANITIZE, if the file is empty, remove it.
if (!(File.ReadLines(file).Count() > 0)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong style, space before (

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not simply look if sanitized is empty ?
instead of reading back the file (that was just written)

@@ -178,7 +178,7 @@ static void NoFixedTodo ()
sanitized.Remove (failure);
File.WriteAllLines (file, sanitized);
// since we are in AUTO_SANITIZE, if the file is empty, remove it.
if (!(File.ReadLines(file).Count() > 0)) {
if (!(sanitized.Count () > 0)) {
Copy link
Contributor

@spouliot spouliot Jul 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simpler

if (sanitized.Count == 0) {

No LINQ, no negation

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

API Diff (from PR only) (no change)
Generator Diff (no change)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

2 tests failed, 86 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst/Debug [dotnet]: Failed (Tests run: 2629 Passed: 2488 Inconclusive: 35 Failed: 1 Ignored: 140)
  • framework-test/Mac Catalyst/Debug: TimedOut (Execution timed out after 1200 seconds.
    No test log file was produced)

Pipeline on Agent XAMBOT-1101.BigSur'
Merge b6d4d7a into f611cd8

@mandel-macaque mandel-macaque merged commit 3336910 into dotnet:main Jul 28, 2021
@mandel-macaque mandel-macaque deleted the rolf-cleans-manuel-complains branch July 28, 2021 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-notes-worthy Ignore for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants