Commit graph

130 commits

Author SHA1 Message Date
xtqqczze 883ca98dd7
Seal private classes (#15725)
* Seal private classes

* Fix CS0509

* Fix CS0628
2021-07-19 14:09:12 +05:00
Ilya 91e7298fd8
Use static lambda keyword (#15154) 2021-04-12 12:44:05 -07:00
Steve Lee c008e3e930
Turn on and off DECCKM to modify keyboard mode for Unix native commands to work correctly (#14943) 2021-04-01 13:01:31 -07:00
Steve Lee cbd97d0cab
Re-enable VT mode on Windows after running command in ConsoleHost (#14413) 2021-03-09 16:02:16 -08:00
xtqqczze 9d4665f32f
Enable SA1003: Symbols should be spaced correctly (#14476)
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1003.md
2020-12-23 21:21:26 +05:00
Ilya 548e939894
Use StringComparison.Ordinal insted of StringComparison.CurrentCulture (#14298) 2020-12-02 13:35:29 -08:00
xtqqczze 3c1261f90d
Enable SA1643: Destructor summary documentation should begin with standard text (#14236)
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1643.md
2020-11-26 10:39:27 +05:00
xtqqczze 0d1ea73e59
Enable IDE0074: Use coalesce compound assignment (#13396)
* Autofix IDE0074: Use compound assignment
2020-11-25 17:37:01 +05:00
xtqqczze c7bdb24ff3
Mark local variable as const (#13217)
RCS1118: Mark local variable as const https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1118.md
2020-11-24 20:06:16 +05:00
xtqqczze 8611c86673
Fix CA1822: Mark members as static part 5 (#14228)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1822
2020-11-24 12:26:04 +05:00
xtqqczze f14c76aab9
Enable SA1516: Elements should be separated by blank line (#14137)
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1516.md
2020-11-20 16:11:36 +05:00
xtqqczze 006fe4d2dd
Enable IDE0082: ConvertTypeOfToNameOf (#14042)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0082
2020-11-16 19:56:07 +05:00
xtqqczze 8148968546
Remove unnecessary usings part 5 (#14050)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005
2020-11-13 08:37:41 +05:00
xtqqczze 4d2965af29
Autofix SA1518: The code must not contain extra blank lines at the end of the file (#13574) 2020-11-11 12:15:20 +05:00
xtqqczze 76be8f3ce5
Fix RCS1033: Remove redundant boolean literal part 1 (#13454)
* Remove redundant boolean literal

Autofix RCS1033: Remove redundant boolean literal

* revert changes in System.Management.Automation
2020-11-05 22:23:27 +05:00
xtqqczze 03a58c4186
Use is not syntax part 2 (#13338) 2020-11-05 10:23:50 +05:00
xtqqczze af8558b065
Enable CA1834: Consider using 'StringBuilder.Append(char)' when applicable (#13878)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1834
2020-10-30 12:07:18 +05:00
xtqqczze f40a002497
Fix IDE0044: MakeFieldReadonly part 5 (#13888)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-10-30 11:49:23 +05:00
xtqqczze 16f0b74187
Cleanup: Remove redundant empty lines (#13404) 2020-08-25 11:29:26 -07:00
Dongbo Wang 6615fa3df6
Fix test hooks for CommandLineParameterParser (#13459) 2020-08-21 11:59:30 -07:00
Ilya 68d46c1792
Refactor command line parser to do early parsing (#11482) 2020-08-12 09:58:46 -07:00
xtqqczze d8f8f0a8bc
Fix comparison of value type object to null (#13285) 2020-08-10 14:56:14 -07:00
Dongbo Wang 4b9b0788ed
Revert "Use is null syntax (#13277)" (#13322)
This reverts commit 6c03776d74.
2020-07-30 16:06:38 -07:00
xtqqczze 6c03776d74
Use is null syntax (#13277)
Replace `== null` with `is null`
2020-07-30 18:04:03 +05:00
xtqqczze 58c371ca31
Fix RCS1114: Remove redundant delegate creation (#12917) 2020-06-11 14:01:01 +05:00
xtqqczze 0d5d017f0f
Code redundancy fixes (#12916)
* Autofix `RCS1036: Remove redundant empty line`

* Autofix `RCS1037: Remove trailing white-space`

* Autofix `RCS1033: Remove redundant boolean literal`

* Autofix: `RCS1038: Remove empty statement`

* Autofix `RCS1041: Remove empty initializer`

* Autofix `RCS1097: Remove redundant 'ToString' call

* Autofix: `RCS1420: Operator is unnecessary`
2020-06-11 11:25:35 +05:00
xtqqczze 9212aac0fa
Use nameof operator (#12716)
# PR Summary

Using *Roslynator Command Line Tool version 0.1.0.4*

* Fix RCS1015:
  * `"argument"` → `nameof(argument)`
  * `enum.ToString()` → `nameof(enum)`

[RCS1015.log](https://github.com/PowerShell/PowerShell/files/4646102/RCS1015.log)


## PR Context

<!-- Provide a little reasoning as to why this Pull Request helps and why you have opened it. -->

## PR Checklist

- [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
    - Use the present tense and imperative mood when describing your changes
- [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress).
    - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready.
- **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)**
    - [x] None
    - **OR**
    - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md)
        - [ ] Experimental feature name(s): <!-- Experimental feature name(s) here -->
- **User-facing changes**
    - [x] Not Applicable
    - **OR**
    - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
        - [ ] Issue filed: <!-- Number/link of that issue here -->
- **Testing - New and feature**
    - [x] N/A or can only be tested interactively
    - **OR**
    - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting)
- **Tooling**
    - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
    - **OR**
    - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include:
        - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host).
        - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.
        - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions).
        - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors).
2020-05-19 18:57:52 +00:00
xtqqczze fde00de77f
Update docs.microsoft.com links (#12653)
# PR Summary

* remove explicit en-us from links
* remove view parameter


## PR Context

follow-up #7013

## PR Checklist

- [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
    - Use the present tense and imperative mood when describing your changes
- [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress).
    - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready.
- **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)**
    - [ ] None
    - **OR**
    - [ ] [Experimental feature(s) needed](https://github.com/MicrosoftDocs/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Experimental_Features.md)
        - [ ] Experimental feature name(s): <!-- Experimental feature name(s) here -->
- **User-facing changes**
    - [x] Not Applicable
    - **OR**
    - [ ] [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
        - [ ] Issue filed: <!-- Number/link of that issue here -->
- **Testing - New and feature**
    - [x] N/A or can only be tested interactively
    - **OR**
    - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting)
- **Tooling**
    - [x] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
    - **OR**
    - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include:
        - Impact on [PowerShell Editor Services](https://github.com/PowerShell/PowerShellEditorServices) which is used in the [PowerShell extension](https://github.com/PowerShell/vscode-powershell) for VSCode (which runs in a different PS Host).
        - Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.
        - Impact on [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer) (which provides linting & formatting in the editor extensions).
        - Impact on [EditorSyntax](https://github.com/PowerShell/EditorSyntax) (which provides syntax highlighting with in VSCode, GitHub, and many other editors).
2020-05-15 03:29:43 +00:00
Steve Lee b7cb335f03
Update copyright notice to latest guidance (#12190) 2020-03-24 11:08:37 -07:00
Steve Lee a1c2d3c977 Fix detection of $PSHOME in front of $env:PATH (#11141) 2019-11-23 15:17:08 -08:00
Steve Lee d8d32d79c2 Implement Get-Error cmdlet as Experimental Feature (#10727) 2019-10-15 14:32:14 -07:00
Dongbo Wang a08d5ee103 Support notification on pwsh startup when a new release is available (#10689) 2019-10-08 15:53:14 -07:00
Steve Lee 8cf9c01800 Add ConciseView for $ErrorView (#10641) 2019-10-04 16:52:57 -07:00
Sotiris Nanopoulos f69f30ba49 Add working directory parameter to Start-Job (#10324) 2019-09-11 10:51:32 -07:00
Ilya fbf4f6c11b Replace ArrayList with List<T> (#10333) 2019-09-05 10:54:18 -07:00
Dongbo Wang b77228906d Skip auto-loading PSReadLine on Windows if the NVDA screen reader is active (#10385) 2019-08-23 09:09:34 +05:00
James Truher [MSFT] fe2cc6aca8 Additional Telemetry - Implementation of RFC0036 (#10336) 2019-08-15 16:13:53 -07:00
Steve Lee 3ca5a1bdb0 Don't collect process starttime as it's not being used on consolehost startup (#10294)
* mark _readyForInputTimeInMS member as part of LEGACYTELEMETRY
* move _interactiveCommandCount to LEGACYTELEMETRY
2019-08-06 08:55:16 +05:00
Steve Lee 2ed9abc99b Enable -sta and -mta switches for pwsh (#10061) 2019-07-25 12:38:52 -07:00
Christoph Bergmeister [MVP] ffc3af2b5d Create JumpList in STA thread as some COM APIs are strictly STA only to avoid sporadic CLR crashes (#10057) 2019-07-09 13:14:49 -07:00
Christoph Bergmeister [MVP] 5d8468c398 Suppress sporadic exceptions from JumpList creation code (#9928) 2019-06-21 10:13:43 +05:00
Ilya 099406e065
Fix style issues from last commits (#9937) 2019-06-21 09:23:19 +05:00
Dongbo Wang 94b6b6f4f7 Clean up the use of 'SetProfileRoot' and 'StartProfile' in ConsoleHost (#9931)
* Clean up the use of 'SetProfileRoot' and 'StartProfile' in ConsoleHost
* Remove 'pwsh.pdb' from our component file list
2019-06-19 11:34:47 +05:00
Ilya ca447c3ad4
Run CodeFormatter with BraceNewLine,UsingLocation,FormatDocument,NewLineAbove rules (#9393) 2019-04-20 23:20:59 +05:00
Staffan Gustafsson 42c289fc8e Improve formatting performance by having better primitives on PSObject (#8785)
By not doing excessive amounts of extra work, formatting can be sped up quite significantly (about 8x faster).
The main change comes from adding new, more efficient, primitive to query an object for the existence of an instance member.
The formatting system has been checking for if an object has properties other than some decorated properties added by PS remoting, and it doesn't this by retrieving all properties which results in heavy allocations and wasted cycles.
By adding `GetFirstOrDefault` to `PSObject` and similar primitives to the underlying Adapters, we are able to return early, without having to get all properties back.
2019-03-20 18:43:52 -07:00
Tyler James Leonhardt 23eccfd641 [feature] Add -CustomPipeName to pwsh and Enter-PSHostProcess (#8889)
This allows a user to start PowerShell up with the name of the named pipe that is used for cross process communication (I.e. Enter-PSHostProcess).
2019-02-22 23:40:03 +05:00
Ilya d80154430d Style: Change first char to upper in summary comments (#8597) 2019-01-09 13:07:40 -08:00
Steve Lee 21fcf070fb Remove unnecessary trim of passed-in command line in interactive debugging (#8594) 2019-01-05 18:47:34 -08:00
Ilya 233b54ed65 Style: Add a space after "//" in comments and remove unneeded comments after "}" (#8576) 2019-01-05 17:51:20 -08:00
Ilya 1be3f4cc0e Style: Add the ending period to the XML document texts (#8577) 2019-01-05 15:40:24 -08:00