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

Standardize file encoding and newlines across repository #1665

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 31 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
root = true

[*]
charset = utf-8
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.cs]
indent_size = 4

[*.ps*1]
charset = utf-8-bom
indent_size = 4

[*.yml]
indent_size = 2

[*.json]
indent_size = 4

[*.xml]
indent_size = 2

# Tests may need to use counterexamples for rules
[Tests/assets/**]
charset = unset
indent_style = unset
end_of_line = unset
trim_trailing_whitespace = unset
2 changes: 1 addition & 1 deletion ADOPTERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ This is a list of adopters of using PowerShell Script Analyzer in production or

* Microsoft Windows Build: PSScriptAnalyzer is automatically run against PowerShell scripts when performing a build for Windows to maintain and improve the quality of code as it gets checked in.
* [PowerShellEditorServices](https://github.com/powershell/powershelleditorservices) uses PowerShell Script Analyzer to provide real-time
linting of PowerShell scripts for editors such as [VSCode](https://code.visualstudio.com/), [Neovim](https://neovim.io/), [IntelliJ](https://www.jetbrains.com/idea/), and others.
linting of PowerShell scripts for editors such as [VSCode](https://code.visualstudio.com/), [Neovim](https://neovim.io/), [IntelliJ](https://www.jetbrains.com/idea/), and others.
2 changes: 1 addition & 1 deletion CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CHANGELOG
# CHANGELOG

## [1.19.1](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.19.1) - 2020-07-28

Expand Down
2 changes: 1 addition & 1 deletion Engine/Commands/GetScriptAnalyzerLoggerCommand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//
//
// Copyright (c) Microsoft Corporation.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Expand Down
2 changes: 1 addition & 1 deletion Engine/Commands/GetScriptAnalyzerRuleCommand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Commands/InvokeScriptAnalyzerCommand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic;
Expand Down
2 changes: 1 addition & 1 deletion Engine/EditableText.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Windows.PowerShell.ScriptAnalyzer.Extensions;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/FindAstPositionVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,4 +366,4 @@ private AstVisitAction Visit(Ast ast)
}

}
}
}
2 changes: 1 addition & 1 deletion Engine/Generic/AvoidCmdletGeneric.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/AvoidParameterGeneric.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/ConfigurableRule.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/ConfigurableRulePropertyAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/ConsoleHostHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/CorrectionExtent.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/DiagnosticRecord.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/DiagnosticRecordHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/ExternalRule.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Globalization;
Expand Down
4 changes: 2 additions & 2 deletions Engine/Generic/IDSCResourceRule.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;
Expand Down Expand Up @@ -32,4 +32,4 @@ public interface IDSCResourceRule : IRule
#endif

}
}
}
2 changes: 1 addition & 1 deletion Engine/Generic/IExternalRule.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/ILogger.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/IRule.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/IScriptRule.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/ITokenRule.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/LoggerInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Diagnostics.CodeAnalysis;
Expand Down
4 changes: 2 additions & 2 deletions Engine/Generic/ModuleDependencyHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#if !PSV3
Expand Down Expand Up @@ -523,4 +523,4 @@ public void Dispose()
#endregion Public Methods
}
}
#endif // !PSV3
#endif // !PSV3
2 changes: 1 addition & 1 deletion Engine/Generic/PathResolver.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/RuleInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/RuleSeverity.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/RuleSuppression.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/SkipNamedBlock.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/SkipTypeDefinition.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/SourceType.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic
Expand Down
2 changes: 1 addition & 1 deletion Engine/Generic/SuppressedRecord.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic
Expand Down
2 changes: 1 addition & 1 deletion Engine/Helper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic;
Expand Down
2 changes: 1 addition & 1 deletion Engine/IOutputWriter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Management.Automation;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Loggers/WriteObjectsLogger.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/PSScriptAnalyzer.psd1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
#
# Module manifest for module 'PSScriptAnalyzer'
#

Expand Down
2 changes: 1 addition & 1 deletion Engine/PSScriptAnalyzer.psm1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
#
# Script module for module 'PSScriptAnalyzer'
#
Set-StrictMode -Version Latest
Expand Down
2 changes: 1 addition & 1 deletion Engine/SafeDirectoryCatalog.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//
//
// Copyright (c) Microsoft Corporation.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Expand Down
2 changes: 1 addition & 1 deletion Engine/ScriptAnalyzer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Text.RegularExpressions;
Expand Down
2 changes: 1 addition & 1 deletion Engine/Settings/CmdletDesign.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
'PSUseSingularNouns',
'PSMissingModuleManifestField',
'PSAvoidDefaultValueSwitchParameter')
}
}
2 changes: 1 addition & 1 deletion Engine/Settings/CodeFormatting.psd1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@{
@{
IncludeRules = @(
'PSPlaceOpenBrace',
'PSPlaceCloseBrace',
Expand Down
2 changes: 1 addition & 1 deletion Engine/Settings/CodeFormattingAllman.psd1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@{
@{
IncludeRules = @(
'PSPlaceOpenBrace',
'PSPlaceCloseBrace',
Expand Down
2 changes: 1 addition & 1 deletion Engine/Settings/CodeFormattingOTBS.psd1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@{
@{
IncludeRules = @(
'PSPlaceOpenBrace',
'PSPlaceCloseBrace',
Expand Down
2 changes: 1 addition & 1 deletion Engine/Settings/CodeFormattingStroustrup.psd1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Inspired by https://eslint.org/docs/rules/brace-style#stroustrup
# Inspired by https://eslint.org/docs/rules/brace-style#stroustrup
@{
IncludeRules = @(
'PSPlaceOpenBrace',
Expand Down
2 changes: 1 addition & 1 deletion Engine/Settings/DSC.psd1
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@{
IncludeRules=@('PSDSC*')
}
}
2 changes: 1 addition & 1 deletion Engine/Settings/PSGallery.psd1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@{
@{
IncludeRules=@('PSUseApprovedVerbs',
'PSReservedCmdletChar',
'PSReservedParams',
Expand Down
2 changes: 1 addition & 1 deletion Engine/Settings/ScriptFunctions.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
'PSAvoidGlobalVars',
'PSUseDeclaredVarsMoreThanAssignments',
'PSAvoidUsingInvokeExpression')
}
}
2 changes: 1 addition & 1 deletion Engine/Settings/ScriptSecurity.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
'PSAvoidUsingConvertToSecureStringWithPlainText',
'PSUsePSCredentialType',
'PSAvoidUsingUserNameAndPasswordParams')
}
}
2 changes: 1 addition & 1 deletion Engine/Settings/ScriptingStyle.psd1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@{
IncludeRules=@('PSProvideCommentHelp',
'PSAvoidUsingWriteHost')
}
}
2 changes: 1 addition & 1 deletion Engine/Settings/desktop-2.0-windows.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"Modules": [
{
"Name": "ADRMS",
Expand Down
2 changes: 1 addition & 1 deletion Engine/Settings/desktop-3.0-windows.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"Modules": [
{
"Name": "AppLocker",
Expand Down
2 changes: 1 addition & 1 deletion Engine/Settings/desktop-4.0-windows.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"Modules": [
{
"Name": "AppLocker",
Expand Down
2 changes: 1 addition & 1 deletion Engine/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Engine/TextEdit.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/TokenOperations.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/VariableAnalysis.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
2 changes: 1 addition & 1 deletion Engine/VariableAnalysisBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
Expand Down
Loading