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

Fix trailing whitespaces #40891

Merged
merged 24 commits into from
Aug 20, 2020
Merged

Conversation

Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Aug 15, 2020

Related to #40887 and #40884

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

Comment on lines 607 to 611
#### Notes
The sample I'm going to walk through implements support for pop count (counting the number of '1' bits in a 64-bit value).
 

We're going to start by assuming that we have a method with a known signature that implements PopCount.
Here's the implementation we're going to use. It simply takes the input value, and keeps anding with one, and then shifting right.
Copy link
Member Author

Choose a reason for hiding this comment

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

This have a visual change, which I think is okay.

before removing the space: The two sentences appeared in the same line.
after removing the space: The two sentences appeared in separate line. I think this is the desired behavior.

@Youssef1313
Copy link
Member Author

I haven't reviewed all the changes. Just picked some files and pointed to examples of undesired changes, and one example of a possibly desired change.

cc: @jkotas @stephentoub What's the action you recommend to do?

@jkotas
Copy link
Member

jkotas commented Aug 15, 2020

Could you please fixup the deltas where you can easily tell that they are not an improvement?

These types of cleanup tend to come with some damage and it is ok. It is hard to be perfect, but we can at least try to reduce the damage.

@jkotas
Copy link
Member

jkotas commented Aug 15, 2020

Thank you for cleaning this up!

Comment on lines +10 to 12
1) No managed frames on stack

If you call DoStackSnapshot when there are no managed functions on your target thread's stack, you can get E\_FAIL. For example, if you try to walk the stack of a target thread very early on in its execution, there simply might not be any managed frames there yet. Or, if you try to walk the stack of the finalizer thread while it's waiting to do work, there will certainly be no managed frames on its stack. It's also possible that walking a stack with no managed frames on it will yield S\_OK instead of E\_FAIL (e.g., if the target thread is jit-compiling the first managed function to be called on that thread). Again, your code probably doesn't need to worry about all these cases. If we call your StackSnapshotCallback for a managed frame, you can trust that frame is there. If we don't call your StackSnapshotCallback, you can assume there are no managed frames on the stack.
Copy link
Member Author

Choose a reason for hiding this comment

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

This text shows as if it's outside the list item. The rule MD0029 is capable of detecting such violations. So, if you want to fix that, I think it worth to be in a separate PR to fix all violations reported by that rule.

@CoffeeFlux
Copy link
Contributor

Thanks for doing this!

jkotas and others added 3 commits August 16, 2020 09:02
…ature Blob Parser for your Profiler.md

Co-authored-by: Youssef Victor <31348972+Youssef1313@users.noreply.github.com>
…ature Blob Parser for your Profiler.md

Co-authored-by: Youssef Victor <31348972+Youssef1313@users.noreply.github.com>
Comment on lines +124 to +126
Three
Helper (marked for deferred pop)
Main
Copy link
Member Author

Choose a reason for hiding this comment

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

Explicit new lines or code block?

NotifyTypeSimple()
NotifyEndType()
NotifyEndParam()
_… (more parameter notifications occur here if more parameters exist)_
Copy link
Member Author

Choose a reason for hiding this comment

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

Now that this became a part of code fence, the underscores won't make it italic.

@jkotas Do you want to delete the underscores?

Suggested change
_… (more parameter notifications occur here if more parameters exist)_
… (more parameter notifications occur here if more parameters exist)

@Youssef1313
Copy link
Member Author

@jkotas I've done more fixes. Can you review again?

I also just noticed that pipelines run with this PR, although it doesn't touch any code files. The YML configuration for pipelines excludes the following:

    - eng/Version.Details.xml
    - .github/*
    - docs/*
    - CODE-OF-CONDUCT.md
    - CONTRIBUTING.md
    - LICENSE.TXT
    - PATENTS.TXT
    - README.md
    - SECURITY.md
    - THIRD-PARTY-NOTICES.TXT

shouldn't it exclude ALL markdown files? Not only the mentioned ones? with something like the following:

    - eng/Version.Details.xml
    - .github/*
    - docs/*
    - LICENSE.TXT
    - PATENTS.TXT
    - THIRD-PARTY-NOTICES.TXT
    - '/**/*.md'

Or are there any code/tests that relies on some md files?

@Youssef1313
Copy link
Member Author

Youssef1313 commented Aug 16, 2020

@stephentoub @jkotas I also would still recommend disabling trailing_whitespaces from editorconfig for markdown files, and keep it enabled as it's for C# files as there is an analyzer that checks that. Later, if you enabled GH actions and added a markdownlint with MD009 rule enabled, it would be safe to enable trailing_whitespaces for .md again.

And thanks for being so helpful to the community. 🎉

@jkotas
Copy link
Member

jkotas commented Aug 20, 2020

I also just noticed that pipelines run with this PR, although it doesn't touch any code files.
Or are there any code/tests that relies on some md files?

This can be fixed together with the .md files that are not actually markdown files under mono

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thank you!

@jkotas jkotas merged commit d14b50a into dotnet:master Aug 20, 2020
@Youssef1313 Youssef1313 deleted the fix-trailing-whitespaces branch August 20, 2020 06:13
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants