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

Remove usages of 'Foo' from our codebase. #21224

Merged
merged 4 commits into from
Aug 1, 2017

Conversation

CyrusNajmabadi
Copy link
Member

It doesn't pass policheck.

@CyrusNajmabadi
Copy link
Member Author

Tagging @jaredpar . I preserved casing as that's very significant for many usages of these variables. i.e. if we had "fOo" it was changed to "gOo".

I expect some failures after the first wave. Specifically, for things like completion or matching where we'll have to change what is typed to match. i.e. we'll likely have to change an "f" that was typed in a test to a "g".

@CyrusNajmabadi CyrusNajmabadi force-pushed the foobar branch 3 times, most recently from 218d526 to 8f07791 Compare July 31, 2017 22:45
@@ -1063,7 +1063,7 @@ public IAliasSymbol GetAliasInfo(IdentifierNameSyntax nameSyntax, CancellationTo
if (!CanGetSemanticInfo(nameSyntax))
return null;

SymbolInfo info = GetSymbolInfoWorker(nameSyntax, SymbolInfoOptions.PreferTypeToConstructors | SymbolInfoOptions.PreserveAliases, cancellationToken);
SymbolInfo info = GetSymbolInfoWorker(nameSyntax, SymbolIngoOptions.PreferTypeToConstructors | SymbolIngoOptions.PreserveAliases, cancellationToken);
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems unintentional

Copy link
Member

@sharwell sharwell left a comment

Choose a reason for hiding this comment

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

For all practical purposes, I'm 👎 on this change unless both of the following conditions are met:

  1. Test cases which changed are individually reviewed to ensure the new test preserves the original intent of the test.
  2. The new name in each case is more meaningful in the context of the test.

Outside of these conditions, I do not believe it is possible for the incremental benefit to outweigh the increased change of a future regression going uncaught.

@CyrusNajmabadi CyrusNajmabadi force-pushed the foobar branch 6 times, most recently from 998bb8a to 6d15d8f Compare August 1, 2017 01:48
@CyrusNajmabadi
Copy link
Member Author

The new name in each case is more meaningful in the context of the test.

I don't see any reason why the new name needs to be any more meaningful. It can be equally as meaningless as the current name. The benefit here is that we are now no longer being flagged by policheck. And it makes it easier for new code to checked for not adding new violations.

@CyrusNajmabadi CyrusNajmabadi force-pushed the foobar branch 5 times, most recently from f4ee1c0 to 90f5fc3 Compare August 1, 2017 02:47
@jaredpar
Copy link
Member

jaredpar commented Aug 1, 2017

// TODO: Consider reducing the table memory gootprint.

This edit should be reverted


Refers to: src/Compilers/Core/Portable/Desktop/DesktopAssemblyIdentityComparer.Fx.cs:14 in 1044d3a. [](commit_id = 1044d3a6778418390327d105f2f8355b94fe464f, deletion_comment = False)

@jaredpar
Copy link
Member

jaredpar commented Aug 1, 2017

    /// when the resulting reference becomes unreachable and GC collects it. To decrease memory gootprint of the reference and/or manage

This edit should be reverted.


Refers to: src/Compilers/Core/Portable/MetadataReference/MetadataReference.cs:182 in 1044d3a. [](commit_id = 1044d3a6778418390327d105f2f8355b94fe464f, deletion_comment = False)

@jaredpar
Copy link
Member

jaredpar commented Aug 1, 2017

    /// when the resulting reference becomes unreachable and GC collects it. To decrease memory gootprint of the reference and/or manage

This edit should be reverted.


Refers to: src/Compilers/Core/Portable/MetadataReference/MetadataReference.cs:220 in 1044d3a. [](commit_id = 1044d3a6778418390327d105f2f8355b94fe464f, deletion_comment = False)

@CyrusNajmabadi CyrusNajmabadi force-pushed the foobar branch 2 times, most recently from 23872bb to 6bdf1c7 Compare August 1, 2017 16:38
@jaredpar
Copy link
Member

jaredpar commented Aug 1, 2017

@CyrusNajmabadi for any future edits here please push commits vs. a rebase. Will help with the review as it's a giant change. We can squash before merging.

@CyrusNajmabadi
Copy link
Member Author

Changes made. Also, updated tool to not match these in the future. Words that start with 'foo' must be followed by a non-letter, or 'b', or a capital letter. 'fool, food, foot' will no longer be caught. I also went and audited all the gool's, goot's and 'good's' to transform them back.

@jaredpar
Copy link
Member

jaredpar commented Aug 1, 2017

I have reviewed all of the compiler changes and they look good to me. Will need sign off from other parts of the code base though.

@CyrusNajmabadi
Copy link
Member Author

for any future edits here please push commits vs. a rebase.

Will do!

@CyrusNajmabadi
Copy link
Member Author

@dotnet/roslyn-ide can you take a look?

Copy link
Contributor

@dpoeschl dpoeschl left a comment

Choose a reason for hiding this comment

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

Did a pretty thorough spot check and only found the "ifoo" thing and the file name thing (and the BOM thing)

@@ -1,4 +1,4 @@
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Symbols;
Copy link
Contributor

Choose a reason for hiding this comment

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

The first line of every file (with/without copyright header) appears changed. What's up with that?

Copy link
Contributor

Choose a reason for hiding this comment

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

BOM?

Copy link
Member

Choose a reason for hiding this comment

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

@dpoeschl yeah it's the BOM. we should fix that as @sharwell just did a change to add the BOM, this appears to be undoing that.

Guess codeflow hides this difference which is why I missed it.

IFoo ifoo = foo;
Goo goo = new Goo();
goo.M();
IGoo ifoo = goo;
Copy link
Contributor

Choose a reason for hiding this comment

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

"ifoo" seems suspicious



public class Foo
public class Goo
Copy link
Contributor

Choose a reason for hiding this comment

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

The file name is OtherStuff_Foo.cs

@CyrusNajmabadi CyrusNajmabadi dismissed sharwell’s stale review August 1, 2017 20:13

Discussed with stakeholders. We're moving ahead with this.

@CyrusNajmabadi
Copy link
Member Author

CyrusNajmabadi commented Aug 1, 2017

Bom bom bom bom Bombara Ann

@CyrusNajmabadi
Copy link
Member Author

BOMs have been ordered.

@CyrusNajmabadi
Copy link
Member Author

CyrusNajmabadi commented Aug 1, 2017

@jaredpar Are you good now that BOMs have returned?

@CyrusNajmabadi
Copy link
Member Author

retest windows_debug_vs-integration_prtest please

@CyrusNajmabadi CyrusNajmabadi merged commit 94ab292 into dotnet:master Aug 1, 2017
@CyrusNajmabadi CyrusNajmabadi deleted the foobar branch August 1, 2017 23:44
333fred added a commit to 333fred/roslyn that referenced this pull request Aug 7, 2017
…sion-expression-rewrite

* dotnet/features/ioperation: (31 commits)
  Fix lambda EnC (dotnet#21291)
  Use 15.3 Preview 7 for VSI CI machines
  Add cancellation between each document.
  Remove unused private method (dotnet#21268)
  Work around SDK 1.1 issue around netcoreapp2.0
  Update Language Feature Status.md
  Const warnings shouldn't cause emit error (dotnet#20729)
  Fix the symbol test
  Choose test config based on TargetFramework
  Standardize on the portable ThrowingTraceListener
  Enforce using UnitTestPortable
  Correct the order of parameters to Version
  Clean up RunCsc/Vbc.cmd a tiny bit
  Remove usages of 'Foo' from our codebase. (dotnet#21224)
  Make RunCsc/Vbc scripts respect DOTNET_HOST_PATH
  Fix typo
  ignoring exceptions about not running on main thread
  Updating VisualStudioSymbolSearchProgressService to consume new API
  Updating visual studio references
  Accept pre-rel version number
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants