Commit graph

3859 commits

Author SHA1 Message Date
xtqqczze d92984106a
Enable SA1507: Code should not contain multiple blank lines in a row (#14136)
https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1507.md
2020-11-20 16:17:45 +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 9e285298c0
Enable IDE0031: Null check can be simplified (#13548)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0031
2020-11-20 11:42:51 +05:00
xtqqczze b5902a6e9f
Enable CA1065: Do not raise exceptions in unexpected locations (#14117) 2020-11-19 12:12:12 -08:00
xtqqczze c9df1c1810
Fix whitespace issues (#14092) 2020-11-19 10:06:02 +05:00
Dongbo Wang 9b57c6e429
Revert "Fix nullable usage on authenticode (#13791) (#13804)" (#14134)
This reverts commit fbca9141ec.
2020-11-19 08:16:10 +05:00
Dongbo Wang 40cbee4ffa
Revert "Change Nullable usage (#13793)" (#14135)
This reverts commit 2e0b51d970.
2020-11-19 08:14:54 +05:00
James Truher [MSFT] 9ca6be1d63
Revert "Update hyperlink for DefaultPromptFunctionText (#13176)" (#14107) 2020-11-17 09:50:59 -08:00
xtqqczze a0e9d7b040
Enable IDE0041: UseIsNullCheck (#14041)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0041
2020-11-16 19:57:48 +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 fcd9e37341
Remove unnecessary usings part 4 (#14023)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005
2020-11-16 19:54:05 +05:00
Ilya d9090b4a49
Write better error message if config file is broken (#13496) 2020-11-13 17:22:26 -08:00
Christopher Yeleighton f13d27ba3e
Update hyperlink for DefaultPromptFunctionText (#13176) 2020-11-13 17:20:15 -08:00
dependabot-preview[bot] 2efa1634e5
Bump NJsonSchema from 10.2.2 to 10.3.1 (#14040) 2020-11-13 14:19:30 -08:00
xtqqczze b521b858ad
Fix RCS1049: Simplify boolean comparison (#13994)
* Fix RCS1049: Simplify boolean comparison

https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1049.md

Related https://github.com/dotnet/runtime/pull/44564
2020-11-13 09:39:25 +05:00
xtqqczze f6caf2d5c6
Enable nullable: System.Management.Automation.Internal.IValidateSetValuesGenerator (#14018) 2020-11-13 09:36:43 +05:00
xtqqczze 1dc0ba4a69
Enable IDE0062: MakeLocalFunctionStatic (#14044)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0062
2020-11-13 09:12:38 +05:00
xtqqczze 5c874207ec
Enable CA1837: Use 'Environment.ProcessId' (#14063)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1837
2020-11-13 08:47:23 +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 70dea4188e
Remove unnecessary usings part 6 (#14065)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005
2020-11-13 08:35:40 +05:00
dependabot-preview[bot] 112d3a88b6
Bump Microsoft.CodeAnalysis.CSharp from 3.7.0 to 3.8.0 (#14075)
Bumps [Microsoft.CodeAnalysis.CSharp](https://github.com/dotnet/roslyn) from 3.7.0 to 3.8.0.
- [Release notes](https://github.com/dotnet/roslyn/releases)
- [Changelog](https://github.com/dotnet/roslyn/blob/master/docs/Breaking%20API%20Changes.md)
- [Commits](https://github.com/dotnet/roslyn/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-13 08:33:53 +05:00
xtqqczze cfcc8dc0ed
Remove unnecessary usings part7 (#14066)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005
2020-11-13 08:14:29 +05:00
Aditya Patwardhan a22e7ec2f3
Update README and metadata json for upcoming release (#14026) 2020-11-11 12:03:18 -08:00
xtqqczze 1386d0054a
Remove LINQ Count method uses (#13545) 2020-11-11 09:39:59 -08: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 39205ca4de
Enable CA1827: Do not use Count() or LongCount() when Any() can be used (#13923)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1827
2020-11-11 11:53:30 +05:00
Marcos Ramos 11d7587f9b
Fix nullable usage on displayDescriptionData_Wide (#13805) 2020-11-10 12:19:17 -08:00
Marcos Ramos 60a8fa3ec8
Fix nullable usage on displayDescriptionData_Table.cs (#13808) 2020-11-10 12:18:47 -08:00
xtqqczze 8cdc421051
Remove unnecessary usings part 3 (#14021)
* Fix IDE0005: Remove unnecessary import

https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005

* Sort usings
2020-11-10 08:18:03 +05:00
xtqqczze 6b009c11e3
Remove unnecessary usings part 2 (#14017)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005
2020-11-10 08:15:04 +05:00
xtqqczze 8f0c63156e
Remove unnecessary usings part 1 (#14014)
* Fix IDE0005: Remove unnecessary import

https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005

* Sort usings
2020-11-10 08:13:11 +05:00
xtqqczze 23deb41f49
Enable IDE0040: AddAccessibilityModifiers (#13962)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0040
2020-11-09 09:37:25 +05:00
xtqqczze ed595c0406
Revert changes to ComInterop (#14012)
* Revert changes to ComInterop

src/System.Management.Automation/engine/ComInterop/

* Disable code analysis in ComInterop
2020-11-09 09:09:13 +05:00
xtqqczze 093edbb9a9
Make applicable private Guid fields readonly (#14000)
* Make applicable private Guid fields readonly

* Use in-modifier for passing a readonly Guid
2020-11-08 10:43:59 +05:00
xtqqczze d128fbc1a8
Fix IDE0044: MakeFieldReadonly part 11 (#13966)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-11-07 16:36:04 +05:00
xtqqczze 2e24380b8c
Fix CA1003: Use generic event handler instances (#13937)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1003
2020-11-07 16:30:19 +05:00
xtqqczze d6727dcf1b
Simplify delegate creation (#13578)
* Autofix RCS1048

* Autofix RCS1021
2020-11-05 22:25:26 +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 76cef3b299
Fix RCS1221: Use pattern matching instead of combination of 'as' operator and null check (#13333)
* Autofix RCS1221: Use pattern matching instead of combination of 'as' operator and null check

https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1221.md

* Restore stripped comments
2020-11-05 21:58:48 +05:00
xtqqczze 03a58c4186
Use is not syntax part 2 (#13338) 2020-11-05 10:23:50 +05:00
xtqqczze 45ffc2c6e5
Replace magic number with constant in PDH (#13536)
* Replace magic number with constant

* Remove useless assignment (codacy)
2020-11-05 10:09:38 +05:00
xtqqczze eaad6c2235
Fix accessor order (#13538)
* Fix Microsoft.PowerShell.Commands.Utility

* Fix System.Management.Automation

* Fix Microsoft.Management.Infrastructure.CimCmdlets

* Fix Microsoft.PowerShell.Commands.Management

* Fix Microsoft.WSMan.Management
2020-11-05 10:05:50 +05:00
xtqqczze 3ba61069b8
Enable IDE0054: Use compound assignment (#13546)
* Autofix IDE0054
https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0054-ide0074
2020-11-05 09:48:13 +05:00
xtqqczze 03a0ef26e6
Fix RCS1098: Constant values should be on right side of comparisons (#13833)
* Fix RCS1098: Constant values should be on right side of comparisons

https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1098.md
2020-11-05 09:13:12 +05:00
xtqqczze 47c92090db
Enable CA1068: CancellationToken parameters must come last (#13867)
* Enable CA1068: CancellationToken parameters must come last
2020-11-05 09:08:28 +05:00
xtqqczze 4ed88dedbc
Fix IDE0044: MakeFieldReadonly part 12 (#13967)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-11-05 08:36:23 +05:00
xtqqczze 4653e9e335
Fix IDE0044: MakeFieldReadonly part 13 (#13968)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-11-05 08:29:50 +05:00
xtqqczze 24facfb03d
Fix IDE0044: MakeFieldReadonly part 15 (#13970)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-11-05 08:28:18 +05:00
xtqqczze 4595a22c64
Fix IDE0044: MakeFieldReadonly part 16 (#13971)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-11-05 08:26:39 +05:00
xtqqczze 52ecb6d18e
Run dotnet-format to improve formatting of source code (#13503) 2020-11-04 11:13:56 -08:00
Sean Wheeler beb074d4a2
Update pwsh -? output to match docs (#13748) 2020-11-04 10:39:07 -08:00
xtqqczze 1d7a93c2e0
Enable CA1825: Avoid zero-length array allocations (#13961) 2020-11-04 08:56:26 +05:00
xtqqczze 3444595e78
Mark PowerShellAssemblyLoadContextInitializer with static modifier (#13874) 2020-11-03 17:16:36 -08:00
xtqqczze cc6ce4f66d
Fix IDE0044: MakeFieldReadonly part 14 (#13969) 2020-11-03 08:47:07 -08:00
Ilya 53e8199856
Fix a logic bug in MapSecurityZone (#13921) 2020-11-02 19:39:31 -08:00
Aditya Patwardhan d50a983367
Bump Microsoft.PowerShell.Native version from 7.1.0-rc.2 to 7.1.0 (#13976) 2020-11-02 16:56:22 -08:00
Dongbo Wang 8d88737fcc
Update PSReadLine version to 2.1.0 (#13975) 2020-11-02 16:53:05 -08:00
Aditya Patwardhan e99f055c69
Bump .NET to version 5.0.100-rtm.20526.5 (#13920) 2020-11-02 16:51:35 -08:00
Thomas Nieto f03952fc3c
Remove unnecessary using in utils folder (#13863) 2020-11-02 12:47:29 +05:00
xtqqczze 739b55d459
Fix IDE0044: MakeFieldReadonly part 1 (#13884)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-11-02 12:43:04 +05:00
xtqqczze 25a769d75d
Fix IDE0044: MakeFieldReadonly part 8 (#13891)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-11-02 12:24:43 +05:00
xtqqczze d9187e07e1
Fix IDE0044: MakeFieldReadonly part 4 (#13887)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-11-02 12:22:18 +05:00
xtqqczze 4b9f9dc457
Enable CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder (#13926)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1830
2020-11-02 08:46:40 +05:00
xtqqczze fc15daaccb
Enable IDE0036: OrderModifiers (#13958)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0036
2020-11-02 08:27:23 +05:00
Marcos Ramos fbca9141ec
Fix nullable usage on authenticode (#13791) (#13804) 2020-10-30 14:46:16 -07:00
Pat Leong 72608fb829
Use Environment.CurrentManagedThreadId (#13803) 2020-10-30 12:42:17 +05:00
xtqqczze 2c1546cd47
Enable CA1836: Prefer IsEmpty over Count when available (#13877)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1836
2020-10-30 12:15:29 +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 ac9846bf40
Fix IDE0044: MakeFieldReadonly part 2 (#13885)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-10-30 11:58:48 +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 c4f6bfe771
Fix IDE0044: MakeFieldReadonly part 9 (#13892)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-10-29 20:56:03 +05:00
xtqqczze 604ce991fe
Fix IDE0044: MakeFieldReadonly part 6 (#13889)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-10-29 16:10:26 +05:00
xtqqczze bcca5f4adb
Fix IDE0044: MakeFieldReadonly part 3 (#13886)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-10-29 16:03:50 +05:00
xtqqczze e1d72101ae
Fix IDE0044: MakeFieldReadonly part 7 (#13890)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-10-29 15:59:00 +05:00
xtqqczze 20401c9583
Enable IDE1005: InvokeDelegateWithConditionalAccess (#13911)
* Enable IDE1005: InvokeDelegateWithConditionalAccess

https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide1005
2020-10-28 22:35:51 +05:00
xtqqczze 69ded7777a
Use span-based string.Concat inatead of string.Substring (#13500)
Before:

```csharp
str1 + str2.Substring(...) + str3
```

After:
```csharp
string.Concat(str1, str2.AsSpan(...), str3)
```
2020-10-28 13:01:05 +05:00
Ilya dfc591c218
Fix NRE in Test-Json (#12942) 2020-10-27 13:54:52 -07:00
xtqqczze ab378f6236
Add global AnalyzerConfig with default configuration (#13835)
* Add default global AnalyzerConfig

Add `microsoft.codeanalysis.netanalyzers\5.0.0-rtm.20502.2\editorconfig\AllRulesDefault\.editorconfig`

* Disable diagnostics for Microsoft.Management.UI.Internal

* Add IDE diagnostics to AnalyzerConfig

Copied from:
<3b6600cbef/eng/CodeAnalysis.ruleset> and converted using `RulesetToEditorconfigConverter.exe`
2020-10-26 21:11:09 +05:00
Thomas Nieto 9b39f05557
Remove unnecessary using in namespaces folder (#13860) 2020-10-25 09:08:05 -07:00
Thomas Nieto 9bbba286c0
Remove unnecessary using in security folder (#13861) 2020-10-25 19:39:10 +05:00
krishnayalavarthi c8feddb214
Make dispose in TranscriptionOption idempotent (#13839)
Co-authored-by: Krishna Yalavarthi <kryalava@microsoft.com>
2020-10-23 11:36:53 -07:00
Thomas Nieto 34251ed12b
Remove unnessary using (#13814) 2020-10-21 17:48:32 +05:00
Sydney Smith 1a3721a574
Add PowerShell Modules to the tracked modules list (#12183) 2020-10-19 13:21:43 -07:00
Ron Green 2e0b51d970
Change Nullable usage (#13793) 2020-10-19 10:38:48 +05:00
Aditya Patwardhan 67bdf7292d
Bump Microsoft.PowerShell.Native to 7.1.0-rc.2 (#13794) 2020-10-16 16:25:47 -07:00
Jordan Borean 5fe17baa3b
Relax further SSL verification checks for WSMan on non-Windows hosts with verification available (#13786) 2020-10-16 09:57:42 -07:00
Aditya Patwardhan 49b7faa817
Move PowerShell build to .NET 5 RC.2 (#13780) 2020-10-14 11:04:39 -07:00
Robert Holt 56ad41b143
Add missing PSToken entries (#13779) 2020-10-14 11:02:54 -07:00
Dongbo Wang 5025d468f3
Update PSReadLine version to 2.1.0-rc1 (#13777)
* Update PSReadLine version to 2.1.0-rc1

* Update the file 'files.wxs'
2020-10-14 09:58:09 -07:00
Dongbo Wang 2728574df7
Rename 'Get-Subsystem' to 'Get-PSSubsystem' and fix two minor issues (#13765) 2020-10-14 09:42:37 -07:00
Xavier Hahn cf251a97d2
Change default fallback encoding for GetEncoding in Start-Transcript (#13732) 2020-10-09 10:43:31 -07:00
Thomas Nieto 5aca8637ae
Add Get-ExperimentalFeature OutputType attribute (#13738) 2020-10-08 13:32:19 -07:00
Steve Lee 16cc9aaaf8
Fix blocking wait when starting file associated with a Windows application (#13750)
* Fix blocking wait when starting file associated with a Windows application in elevated process

* refactor check if app is WindowsApp
2020-10-07 12:58:24 +05:00
dependabot-preview[bot] c3b29cf0e7
Bump NJsonSchema from 10.2.1 to 10.2.2 (#13751)
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-06 12:28:04 -07:00
dependabot-preview[bot] f2a37164bf
Bump Markdig.Signed from 0.21.1 to 0.22.0 (#13741)
Bumps [Markdig.Signed](https://github.com/lunet-io/markdig) from 0.21.1 to 0.22.0.
- [Release notes](https://github.com/lunet-io/markdig/releases)
- [Changelog](https://github.com/lunet-io/markdig/blob/master/changelog.md)
- [Commits](https://github.com/lunet-io/markdig/compare/0.21.1...0.22.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-06 14:43:05 +05:00
Steve Lee fc8ca61b3d
Revert "Change PSNativePSPathResolution to not be Experimental" (#13734)
* Revert "Change `PSNativePSPathResolution` to not be Experimental (#13522)"

This reverts commit 74c743d279.
2020-10-03 21:20:24 +05:00
dependabot-preview[bot] badb4c3fb1
Bump NJsonSchema from 10.1.26 to 10.2.1 (#13722)
Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 10.1.26 to 10.2.1.
- [Release notes](https://github.com/RicoSuter/NJsonSchema/releases)
- [Commits](https://github.com/RicoSuter/NJsonSchema/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-10-02 09:52:41 -07:00
Steve Lee 9bf512ff5d
Emit warning if ConvertTo-Json exceeds -Depth value (#13692) 2020-09-28 21:22:40 +05:00
Steve Lee 36ba1092a8
Fix case where exception message contains "`n" on Windows (#13684) 2020-09-24 23:43:33 +05:00
dependabot-preview[bot] f6dc3dda90
Bump PowerShellGet from 2.2.4 to 2.2.5 (#13683) 2020-09-24 11:38:46 -07:00