Skip to content

Fix typo in dotnet-tools/README.md #19021

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

Merged
merged 1 commit into from
Jan 25, 2023
Merged

Fix typo in dotnet-tools/README.md #19021

merged 1 commit into from
Jan 25, 2023

Conversation

spaette
Copy link
Contributor

@spaette spaette commented Jan 24, 2023

test/perf/dotnet-tools/README.md

@ghost ghost assigned PaulHigin Jan 24, 2023
@spaette
Copy link
Contributor Author

spaette commented Jan 24, 2023

@PaulHigin

For an eventual bulk typo fix PR.

Can I have a clarification of what the fix is here?

$ grep -nr Commmand PowerShell
PowerShell/test/powershell/Language/Parser/UsingNamespace.Tests.ps1:79:        $cmdInfo = Get-Commmand foo
$ 

Can I have a clarification of what the fix is here?

$ pushd PowerShell/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel
/tmp/PowerShell/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel /tmp
$ ed -s CommandViewModel.cs <<<'460p'
        /// Showing help information for current actived cmdlet.
$ popd
/tmp
$ 

Concomitant with typo fixes in PowerShell/PowerShell would removal of a word from .spelling be authorised?

$ ed -s PowerShell/CHANGELOG/7.1.md <<<'696p'
<li>Add missing assessibility modifiers (#12820) (Thanks @xtqqczze!)</li>
$ 

The merged PR above had a link to a page where roslynator_accessibility_modifiers was mentioned.

Add missing assessibility modifiers
Thu, 28 May 2020

The spelling in the commit message was of course incorrect and that spelling found its way into .spelling.

$ ed -s PowerShell/.spelling <<<'73p'
assessibility
$ cd PowerShell
$ git blame .spelling | grep assessibility
Blaming lines: 100% (1667/1667), done.
2f949b7b9d (Aditya Patwardhan           2020-06-25 01:49:09 +0000   73) assessibility
$ 

@pull-request-quantifier-deprecated

This PR has 4 quantified lines of changes. In general, a change size of upto 200 lines is ideal for the best PR experience!


Quantification details

Label      : Extra Small
Size       : +2 -2
Percentile : 1.6%

Total files changed: 1

Change summary by file extension:
.md : +2 -2

Change counts above are quantified counts, based on the PullRequestQuantifier customizations.

Why proper sizing of changes matters

Optimal pull request sizes drive a better predictable PR flow as they strike a
balance between between PR complexity and PR review overhead. PRs within the
optimal size (typical small, or medium sized PRs) mean:

  • Fast and predictable releases to production:
    • Optimal size changes are more likely to be reviewed faster with fewer
      iterations.
    • Similarity in low PR complexity drives similar review times.
  • Review quality is likely higher as complexity is lower:
    • Bugs are more likely to be detected.
    • Code inconsistencies are more likely to be detected.
  • Knowledge sharing is improved within the participants:
    • Small portions can be assimilated better.
  • Better engineering practices are exercised:
    • Solving big problems by dividing them in well contained, smaller problems.
    • Exercising separation of concerns within the code changes.

What can I do to optimize my changes

  • Use the PullRequestQuantifier to quantify your PR accurately
    • Create a context profile for your repo using the context generator
    • Exclude files that are not necessary to be reviewed or do not increase the review complexity. Example: Autogenerated code, docs, project IDE setting files, binaries, etc. Check out the Excluded section from your prquantifier.yaml context profile.
    • Understand your typical change complexity, drive towards the desired complexity by adjusting the label mapping in your prquantifier.yaml context profile.
    • Only use the labels that matter to you, see context specification to customize your prquantifier.yaml context profile.
  • Change your engineering behaviors
    • For PRs that fall outside of the desired spectrum, review the details and check if:
      • Your PR could be split in smaller, self-contained PRs instead
      • Your PR only solves one particular issue. (For example, don't refactor and code new features in the same PR).

How to interpret the change counts in git diff output

  • One line was added: +1 -0
  • One line was deleted: +0 -1
  • One line was modified: +1 -1 (git diff doesn't know about modified, it will
    interpret that line like one addition plus one deletion)
  • Change percentiles: Change characteristics (addition, deletion, modification)
    of this PR in relation to all other PRs within the repository.


Was this comment helpful? 👍  :ok_hand:  :thumbsdown: (Email)
Customize PullRequestQuantifier for this repository.

Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

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

LGTM

@spaette
Copy link
Contributor Author

spaette commented Jan 25, 2023

size of upto 200 lines

If over 200 lines changed should that be in multiple PRs?

@iSazonov iSazonov assigned iSazonov and unassigned PaulHigin Jan 25, 2023
@iSazonov iSazonov added the CL-Docs Indicates that a PR should be marked as a documentation change in the Change Log label Jan 25, 2023
@iSazonov iSazonov changed the title fix typo Fix typo in dotnet-tools/README.md Jan 25, 2023
@iSazonov iSazonov merged commit 44f2792 into PowerShell:master Jan 25, 2023
@iSazonov
Copy link
Collaborator

@spaette Thanks for your contribution!

If over 200 lines changed should that be in multiple PRs?

The best practices are not to mix functional and style changes. This makes code review easier and saves time - this is the main criterion to follow when determining the optimal size of changes and their grouping by PRs and by commits. For example, if you fix one and the same typo in 1000 files, you can do it in one PR but do 20-30 commits with 20-50 files.

@spaette
Copy link
Contributor Author

spaette commented Jan 25, 2023

@iSazonov

Could you respond to the questions I addressed to @PaulHigin?

With those questions answered I could add relevant lines to the below shell script.

Then accordingly the script could be a basis for a single PR.

$ expr $(wc -l < typos.sh) - 2
44
$ cat typos.sh
#!/bin/sh

sed -i "s/Administator/Administrator/g" PowerShell/assets/wix/Product.wxs
sed -i "s/Conter/Counter/g" PowerShell/src/System.Management.Automation/FormatAndOutput/out-console/ConsoleLineOutput.cs
sed -i "s/abreviated/abbreviated/g" PowerShell/test/tools/Modules/PSSysLog/PSSysLog.psm1
sed -i "s/accidently/accidentally/g" PowerShell/src/System.Management.Automation/engine/parser/tokenizer.cs
sed -i "s/additonal/additional/g" PowerShell/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1
sed -i "s/agregate/aggregate/g" PowerShell/src/Microsoft.Management.UI.Internal/ShowCommand/ViewModel/AllModulesViewModel.cs
sed -i "s/alloted/allotted/g" PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/PendingProgress.cs
sed -i "s/appearand/appear/g" PowerShell/src/System.Management.Automation/engine/remoting/fanin/InitialSessionStateProvider.cs
sed -i "s/appropropriate/appropriate/g" PowerShell/test/powershell/Language/Parser/Parser.Tests.ps1
sed -i "s/assests/assets/g" PowerShell/build.psm1
sed -i "s/automaticaly/automatically/g" PowerShell/tools/packaging/packaging.psm1
sed -i "s/avaiable/available/g" PowerShell/test/powershell/Modules/Microsoft.PowerShell.Utility/clixml.tests.ps1
sed -i "s/availablity/availability/g" PowerShell/test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1
sed -i "s/belongiong/belonging/g" PowerShell/src/Microsoft.Management.UI.Internal/commandHelpers/ShowCommandHelper.cs
sed -i "s/boby/body/g" PowerShell/src/System.Management.Automation/engine/parser/ast.cs
sed -i "s/calee/callee/g" PowerShell/src/System.Management.Automation/engine/ComInterop/VarEnumSelector.cs
sed -i "s/callees/callee's/g" PowerShell/src/System.Management.Automation/engine/pipeline.cs
sed -i "s/callers/caller's/g" PowerShell/src/System.Management.Automation/engine/pipeline.cs
sed -i "s/callers module/caller's module/g" PowerShell/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs
sed -i "s/callers context/caller's context/g" PowerShell/src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs
sed -i "s/callers/caller's/g" PowerShell/src/System.Management.Automation/engine/MshCmdlet.cs
sed -i "s/callers context/caller's context/g" PowerShell/src/System.Management.Automation/engine/parser/Compiler.cs
sed -i "s/cant/can't/g" PowerShell/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/EventProvider.cs
sed -i "s/cant/can't/g" PowerShell/src/System.Management.Automation/help/HelpCommands.cs
sed -i "s/collison/collision/g" PowerShell/test/powershell/Modules/Microsoft.PowerShell.LocalAccounts/Pester.Command.Cmdlets.LocalAccounts.LocalUser.Tests.ps1
sed -i "s/combineable/combinable/g" PowerShell/src/TypeCatalogGen/TypeCatalogGen.cs
sed -i "s/compatability/compatibility/g" PowerShell/src/System.Management.Automation/namespaces/FileSystemSecurity.cs
sed -i "s/compatability/compatibility/g" PowerShell/src/System.Management.Automation/engine/remoting/commands/remotingcommandutil.cs
sed -i "s/compatability/compatibility/g" PowerShell/src/System.Management.Automation/engine/InitialSessionState.cs
sed -i "s/complance/compliance/g" PowerShell/tools/releaseBuild/createComplianceFolder.ps1
sed -i "s/complinance Files/compliance files/g" PowerShell/tools/releaseBuild/createComplianceFolder.ps1
sed -i "s/conects/connects/g" PowerShell/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs
sed -i "s/configurtation/configuration/g" PowerShell/test/powershell/Modules/Microsoft.PowerShell.Core/PSSessionConfiguration.Tests.ps1
sed -i "s/configurtion/configuration/g" PowerShell/test/tools/Modules/Microsoft.PowerShell.RemotingTools/Microsoft.PowerShell.RemotingTools.psm1
sed -i "s/conguous/congruous/g" PowerShell/src/System.Management.Automation/engine/CommandCompletion/CommandCompletion.cs
sed -i "s/consistant/consistent/g" PowerShell/test/powershell/Language/Parser/Parsing.Tests.ps1
sed -i "s/constrcutor/constructor/g" PowerShell/src/System.Management.Automation/engine/CoreAdapter.cs
sed -i "s/convertable/convertible/g" PowerShell/src/Microsoft.PowerShell.Commands.Management/commands/management/GetComputerInfoCommand.cs
sed -i "s/convertable/convertible/g" PowerShell/src/System.Management.Automation/engine/NativeCommandParameterBinder.cs
sed -i "s/convertion/conversion/g" PowerShell/test/powershell/engine/Api/LanguagePrimitive.Tests.ps1
sed -i "s/convertor/converter/g" PowerShell/test/powershell/engine/Api/LanguagePrimitive.Tests.ps1
sed -i "s/coverarage/coverage/g" PowerShell/test/tools/Modules/HelpersLanguage/HelpersLanguage.psm1
sed -i "s/coverted/converted/g" PowerShell/src/System.Management.Automation/engine/ComInterop/VarEnumSelector.cs
sed -i "s/ arround/around/g" PowerShell/src/Microsoft.Management.UI.Internal/HelpWindow/ParagraphSearcher.cs
$ 

@iSazonov
Copy link
Collaborator

PowerShell/test/powershell/Language/Parser/UsingNamespace.Tests.ps1:79: $cmdInfo = Get-Commmand foo

It is script. We shouldn't change it.

/// Showing help information for current actived cmdlet.

I guess actived -> active

  • Add missing assessibility modifiers (Add missing accessibility modifiers #12820) (Thanks @xtqqczze!)
  • We should also change the commit description. I suggest you pull separate PR to change the files (7.1.md and .spelling) and ask MSFT team to change the commit too.

    @spaette
    Copy link
    Contributor Author

    spaette commented Jan 26, 2023

    20-30 commits with 20-50

    I'm unclear on your meaning.

    Is that a single PR with multiple commits or multiple PRs?


    A recursive grep for GetCommand and Get\-Command on a cloned repository both return output.

    shouldn't change it

    Your position is noted.

    Other *.ps1 files appear in typos.sh.

    active

    That was my inclination.

    commit description

    I've seen elsewhere a reluctance expressed to change a commit message following a merge.


    a few more typos

    $ grep -n Custome PowerShell/src/PowerShell.Core.Instrumentation/PowerShell.Core.Instrumentation.man
    4872:            value="Request %1. Creating a server remote session. UserName: %2 Custome Shell Id: %3"
    $ 
    

    sed -i "s/Custome/Custom/g" PowerShell/src/PowerShell.Core.Instrumentation/PowerShell.Core.Instrumentation.man

    $ grep -n Custome PowerShell/src/System.Management.Automation/resources/EventResource.resx          
    643:    <value>Request {0}. Creating a server remote session. UserName: {1} Custome Shell Id: {2}</value>
    $ 
    

    sed -i "s/Custome/Custom/g" PowerShell/src/System.Management.Automation/resources/EventResource.resx

    $ ed -s PowerShell/test/powershell/engine/Module/ModulePath.Tests.ps1 <<<'127,133p'
            $customeModules = Join-Path -Path $TestDrive -ChildPath 'CustomModules'
            $env:PSModulePath = $fakePSHomeModuleDir, $customeModules -join ([System.IO.Path]::PathSeparator)
            $newModulePath = & $powershell -nopro -c '$env:PSModulePath'
            $paths = $newModulePath -split [System.IO.Path]::PathSeparator
            $paths.Count | Should -Be 5
            $paths -contains $fakePSHomeModuleDir | Should -BeTrue
            $paths -contains $customeModules | Should -BeTrue
    $ 
    

    sed -i "s/custome/custom/g" PowerShell/test/powershell/engine/Module/ModulePath.Tests.ps1

    $ ed -s PowerShell/src/System.Management.Automation/engine/Modules/ModuleSpecification.cs <<<'130p'
                // Example of catched exception: one of conversions to Version failed.
    $ 
    

    sed -i "s/catched/caught/g" PowerShell/src/System.Management.Automation/engine/Modules/ModuleSpecification.cs

    @spaette
    Copy link
    Contributor Author

    spaette commented Jan 26, 2023

    It is script. We shouldn't change it.

    Can that be more precise.

    Which extension(s) on files are designate them as not slated for typo corrections?

    @iSazonov
    Copy link
    Collaborator

    There is no definite answer. Most of the files where we would see typos are special kind of program files. Even the comments there are not critical. But there are kinds of comments that translate into documentation, such as triple slash XML C# comments, where typos should be corrected. There are also resource strings in resx files, which are XML files. This would also be worth correcting as it is exposed to users.

    @spaette
    Copy link
    Contributor Author

    spaette commented Jan 27, 2023

    #19058

    @spaette
    Copy link
    Contributor Author

    spaette commented Jan 27, 2023

    resx files

    A typo in an .resx file also appears in a .man file.

    I don't know whether the .man file is generated.

    The code under PowerShell.Core.Instrumentation is being migrated to PowerShell-native repository.

    It's unclear in this special case whether both files where the typo appears should be fixed in this repo.

    src/System.Management.Automation/resources/EventResource.resx

    $ grep -n Custome PowerShell/src/System.Management.Automation/resources/EventResource.resx          
    643:    <value>Request {0}. Creating a server remote session. UserName: {1} Custome Shell Id: {2}</value>
    $ 
    

    src/PowerShell.Core.Instrumentation/PowerShell.Core.Instrumentation.man

    $ grep -n Custome PowerShell/src/PowerShell.Core.Instrumentation/PowerShell.Core.Instrumentation.man
    4872:            value="Request %1. Creating a server remote session. UserName: %2 Custome Shell Id: %3"
    $ 
    

    @iSazonov
    Copy link
    Collaborator

    Resx and man files can contain specific names like UserName that is a parameter name or something like. So it is impossible to fix automatically, we have to review every change.

    @spaette
    Copy link
    Contributor Author

    spaette commented Jan 28, 2023

    #19059

    @ghost
    Copy link

    ghost commented Mar 14, 2023

    🎉v7.4.0-preview.2 has been released which incorporates this pull request.:tada:

    Handy links:

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    CL-Docs Indicates that a PR should be marked as a documentation change in the Change Log Extra Small
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    4 participants