Skip to content

Commit

Permalink
Merge pull request PowerShell#1018 from PowerShell/development
Browse files Browse the repository at this point in the history
Merge changes of 1.17.1 (including 1.17.0) into Master
  • Loading branch information
JamesWTruher committed Jun 5, 2018
2 parents 521f41c + 617476b commit 3a3ff48
Show file tree
Hide file tree
Showing 278 changed files with 24,197 additions and 9,681 deletions.
58 changes: 14 additions & 44 deletions .build.ps1
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
param(
[ValidateSet("net451", "netstandard1.6")]
[ValidateSet("net451", "netstandard2.0")]
[string]$Framework = "net451",

[ValidateSet("Debug", "Release", "PSv3Debug", "PSv3Release")]
[ValidateSet("Debug", "Release", "PSv3Debug", "PSv3Release", "PSv4Release")]
[string]$Configuration = "Debug"
)

# todo remove aliases
# todo make each project have its own build script

$resourceScript = Join-Path $BuildRoot "New-StronglyTypedCsFileForResx.ps1"
$outPath = "$BuildRoot/out"
$modulePath = "$outPath/PSScriptAnalyzer"

Expand All @@ -18,9 +17,9 @@ if ($BuildTask -eq "release") {
$buildData = @{
Frameworks = @{
"net451" = @{
Configuration = @('Release', "PSV3Release")
Configuration = @('Release', "PSV3Release", "PSv4Release")
}
"netstandard1.6" = @{
"netstandard2.0" = @{
Configuration = @('Release')
}
}
Expand All @@ -39,20 +38,20 @@ function CreateIfNotExists([string] $folderPath) {
}

function Get-BuildInputs($project) {
pushd $buildRoot/$project
gci -Filter *.cs
gci -Directory -Exclude obj, bin | gci -Filter *.cs -Recurse
popd
Push-Location $buildRoot/$project
Get-ChildItem -Filter *.cs
Get-ChildItem -Directory -Exclude obj, bin | Get-ChildItem -Filter *.cs -Recurse
Pop-Location
}

function Get-BuildOutputs($project) {
$bin = "$buildRoot/$project/bin/$Configuration/$Framework"
$obj = "$buildRoot/$project/obj/$Configuration/$Framework"
if (Test-Path $bin) {
gci $bin -Recurse
Get-ChildItem $bin -Recurse
}
if (Test-Path $obj) {
gci $obj -Recurse
Get-ChildItem $obj -Recurse
}
}

Expand All @@ -79,14 +78,6 @@ function Get-BuildTaskParams($project) {
$taskParams
}

function Get-RestoreTaskParams($project) {
@{
Inputs = "$BuildRoot/$project/project.json"
Outputs = "$BuildRoot/$project/project.lock.json"
Jobs = {dotnet restore}
}
}

function Get-CleanTaskParams($project) {
@{
Jobs = {
Expand All @@ -109,20 +100,6 @@ function Get-TestTaskParam($project) {
}
}

function Get-ResourceTaskParam($project) {
@{
Inputs = "$project/Strings.resx"
Outputs = "$project/Strings.cs"
Data = $project
Jobs = {
Push-Location $BuildRoot
& $resourceScript $Task.Data
Pop-Location
}
Before = "$project/build"
}
}

function Add-ProjectTask([string]$project, [string]$taskName, [hashtable]$taskParams, [string]$pathPrefix = $buildRoot) {
$jobs = [scriptblock]::Create(@"
pushd $pathPrefix/$project
Expand All @@ -136,16 +113,12 @@ popd

$projects = @("engine", "rules")
$projects | ForEach-Object {
Add-ProjectTask $_ buildResource (Get-ResourceTaskParam $_)
Add-ProjectTask $_ build (Get-BuildTaskParams $_)
Add-ProjectTask $_ restore (Get-RestoreTaskParams $_)
Add-ProjectTask $_ clean (Get-CleanTaskParams $_)
Add-ProjectTask $_ test (Get-TestTaskParam $_) "$BuildRoot/tests"
}

task buildResource -Before build "engine/buildResource", "rules/buildResource"
task build "engine/build", "rules/build"
task restore "engine/restore", "rules/restore"
task clean "engine/clean", "rules/clean"
task test "engine/test", "rules/test"

Expand All @@ -172,7 +145,7 @@ task createModule {
$itemsToCopyBinaries = @("$solutionDir\Engine\bin\$Configuration\$Framework\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll",
"$solutionDir\Rules\bin\$Configuration\$Framework\Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll")

if ($Framework -eq "netstandard1.6") {
if ($Framework -eq "netstandard2.0") {
$destinationDirBinaries = "$destinationDir\coreclr"
}
elseif ($Configuration -match 'PSv3') {
Expand Down Expand Up @@ -215,14 +188,11 @@ task buildDocs -Inputs $bdInputs -Outputs $bdOutputs {
$markdownDocsPath = Join-Path $docsPath 'markdown'
CreateIfNotExists($outputDocsPath)

# copy the about help file
Copy-Item -Path $docsPath\about_PSScriptAnalyzer.help.txt -Destination $outputDocsPath -Force

# Build documentation using platyPS
if ((Get-Module PlatyPS -ListAvailable) -eq $null) {
throw "Cannot find PlatyPS. Please install it from https://www.powershellgallery.com."
if ($null -eq (Get-Module platyPS -ListAvailable -Verbose:$verbosity | Where-Object { $_.Version -ge 0.9 })) {
throw "Cannot find platyPS of version greater or equal to 0.9. Please install it from https://www.powershellgallery.com/packages/platyPS/ using e.g. the following command: Install-Module platyPS"
}
Import-Module PlatyPS
Import-Module platyPS
if (-not (Test-Path $markdownDocsPath -Verbose:$verbosity)) {
throw "Cannot find markdown documentation folder."
}
Expand Down
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Bug report 🐛
about: Report errors or unexpected behavior 🤔

---

Before submitting a bug report:

- Make sure you are able to repro it on the latest released version
- Perform a quick search for existing issues to check if this bug has already been reported

Steps to reproduce
------------------

```PowerShell
```

Expected behavior
-----------------

```none
```

Actual behavior
---------------

```none
```

If an unexpected error was thrown then please report the full error details using e.g. `$error[0] | Select-Object *`

Environment data
----------------

<!-- Provide the output of the following 2 commands -->

```PowerShell
> $PSVersionTable
> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
```
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Feature request/idea 🚀
about: Suggest a new feature or improvement (this does not mean you have to implement it)

---

**Summary of the new feature**

A clear and concise description of what the problem is that the new feature would solve.
Try formulating it in user story style (if applicable):
'As a user I want X so that Y.' with X being the being the action and Y being the value of the action.

**Proposed technical implementation details (optional)**

A clear and concise description of what you want to happen.

**What is the latest version of PSScriptAnalyzer at the point of writing**

9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/Support_Question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: Support Question ❓
about: If you have a question, you can try asking in the scriptanalyzer channel of the international PowerShell Slack channel first.

---

* Slack Community Chat: https://powershell.slack.com (you can sign-up at http://slack.poshcode.org/ for an invite)
* Also have a look at the `RoleDocumentation` folder for more information on each rule:
https://github.com/PowerShell/PSScriptAnalyzer/tree/development/RuleDocumentation
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## PR Summary

<!-- summarize your PR between here and the checklist -->

## PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an `x` between the square brackets. Please mark anything not applicable to this PR `NA`.

- [ ] PR has a meaningful title
- [ ] Use the present tense and imperative mood when describing your changes
- [ ] Summarized changes
- [ ] User facing documentation needed
- [ ] Change is not breaking
- [ ] Make sure you've added a new test if existing tests do not effectively test the code changed
- [ ] This PR is ready to merge and is not work in progress
- If the PR is work in progress, please add the prefix `WIP:` to the beginning of the title and remove the prefix when the PR is ready
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TestResult.xml
[Rr]eleasePS/
dlldata.c

# DNX
# .Net Core CLI
project.lock.json
artifacts/

Expand Down
30 changes: 30 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version": "0.2.0",
"configurations": [

{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>",
"args": [],
"cwd": "${workspaceRoot}",
"externalConsole": false,
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
},
{
"name": ".NET Full Attach",
"type": "clr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
98 changes: 97 additions & 1 deletion CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,100 @@
## [1.16.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.16.0) - 2017-08-15
## [1.17.1](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.17.1) - 2018-06-06

### Fixes

- Fix signing so `PSScriptAnalyzer` can be installed without the `-SkipPublisherCheck` switch (#1014)
- Issues with rule `PSAvoidAssignmentToAutomaticVariable` were fixed (#1007, #1013, #1014)
- Rule documentation update and cleanup (#988)

## [1.17.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.17.0) - 2018-06-02

### New Parameters

- Add `-ReportSummary` switch (#895) (Thanks @StingyJack! for the base work that got finalized by @bergmeister)
- Add `-EnableExit` switch to Invoke-ScriptAnalyzer for exit and return exit code for CI purposes (#842) (by @bergmeister)
- Add `-Fix` switch to `-Path` parameter set of `Invoke-ScriptAnalyzer` (#817, #852) (by @bergmeister)

### New Rules and Warnings

- Warn when 'Get-' prefix was omitted in `AvoidAlias` rule. (#927) (by @bergmeister)
- `AvoidAssignmentToAutomaticVariable`. NB: Currently only warns against read-only automatic variables (#864, #917) (by @bergmeister)
- `PossibleIncorrectUsageOfRedirectionOperator` and `PossibleIncorrectUsageOfAssignmentOperator`. (#859, #881) (by @bergmeister)
- Add PSAvoidTrailingWhitespace rule (#820) (Thanks @dlwyatt!)

### Fixes and Improvements

- AvoidDefaultValueForMandatoryParameter triggers when the field has specification: Mandatory=value and value!=0 (#969) (by @kalgiz)
- Do not trigger UseDeclaredVarsMoreThanAssignment for variables being used via Get-Variable (#925) (by @bergmeister)
- Make UseDeclaredVarsMoreThanAssignments not flag drive qualified variables (#958) (by @bergmeister)
- Fix PSUseDeclaredVarsMoreThanAssignments to not give false positives when using += operator (#935) (by @bergmeister)
- Tweak UseConsistentWhiteSpace formatting rule to exclude first unary operator when being used in argument (#949) (by @bergmeister)
- Allow -Setting parameter to resolve setting presets as well when object is still a PSObject in BeginProcessing (#928) (by @bergmeister)
- Add macos detection to New-CommandDataFile (#947) (Thanks @GavinEke!)
- Fix PlaceOpenBrace rule correction to take comment at the end of line into account (#929) (by @bergmeister)
- Do not trigger UseShouldProcessForStateChangingFunctions rule for workflows (#923) (by @bergmeister)
- Fix parsing the -Settings object as a path when the path object originates from an expression (#915) (by @bergmeister)
- Allow relative settings path (#909) (by @bergmeister)
- Fix AvoidDefaultValueForMandatoryParameter documentation, rule and tests (#907) (by @bergmeister)
- Fix NullReferenceException in AlignAssignmentStatement rule when CheckHashtable is enabled (#838) (by @bergmeister)
- Fix FixPSUseDeclaredVarsMoreThanAssignments to also detect variables that are strongly typed (#837) (by @bergmeister)
- Fix PSUseDeclaredVarsMoreThanAssignments when variable is assigned more than once to still give a warning (#836) (by @bergmeister)

### Engine, Building and Testing

- Support `SuggestedCorrections` property on DiagnosticRecord for script based rules #1000 (by @bergmeister)
- Add CommandData files of PowerShell Core 6.0.2 for Windows/Linux/macOS and WMF3/4 that are used by UseCompatibleCmdlets rule (#954) (by @bergmeister)
- If no path is found or when using the -ScriptDefinition parameter set, default to the current location for the directory search of the implicit settings file (#979) (by @bergmeister)
- Allow TypeNotFound parser errors (#957) (by @bergmeister)
- Fix release script by building also for v3 and misc. improvements (#996) (by @bergmeister)
- Scripts needed to build and sign PSSA via MS VSTS so it can be published in the gallery (#983) (by @JamesWTruher)
- Move common test code into AppVeyor module (#961) (by @bergmeister)
- Remove extraneous import-module commands in tests (#962) (by @JamesWTruher)
- Upgrade 'System.Automation.Management' NuGet package of version 6.0.0-alpha13 to version 6.0.2 from powershell-core feed, which requires upgrade to netstandard2.0. NB: This highly improved behavior on WMF3 but also means that the latest patched version (6.0.2) of PowerShell Core should be used. (#919) by @bergmeister)
- Add Ubuntu Build+Test to Appveyor CI (#940) (by @bergmeister)
- Add PowerShell Core Build+Test to Appveyor CI (#939) (by @bergmeister)
- Update Newtonsoft.Json NuGet package of Rules project from 9.0.1 to 10.0.3 (#937) (by @bergmeister)
- Fix Pester v4 installation for `Visual Studio 2017` image and use Pester v4 assertion operator syntax (#892) (by @bergmeister)
- Have a single point of reference for the .Net Core SDK version (#885) (by @bergmeister)
- Fix regressions introduced by PR 882 (#891) (by @bergmeister)
- Changes to allow tests to be run outside of CI (#882) (by @JamesWTruher)
- Upgrade platyPS from Version 0.5 to 0.9 (#869) (by @bergmeister)
- Build using .Net Core SDK 2.1.101 targeting `netstandard2.0` and `net451` (#853, #854, #870, #899, #912, #936) (by @bergmeister)
- Add instructions to make a release (#843) (by @kapilmb)

### Documentation, Error Messages and miscellaneous Improvements

- Added Chocolatey Install help, which has community support (#999) (Thanks @pauby)
- Finalize Release Logs and bump version to 1.17 (#1002) (by @bergmeister)
- Docker examples: (#987, #990) (by @bergmeister)
- Use multiple GitHub issue templates for bugs, feature requests and support questions (#986) (by @bergmeister
- Fix table of contents (#980) (by @bergmeister)
- Improve documentation, especially about parameter usage and the settings file (#968) (by @bergmeister)
- Add base changelog for 1.17.0 (#967) (by @bergmeister)
- Remove outdated about_scriptanalyzer help file (#951) (by @bergmeister)
- Fixes a typo and enhances the documentation for the parameters required for script rules (#942) (Thanks @MWL88!)
- Remove unused using statements and sort them (#931) (by @bergmeister)
- Make licence headers consistent across all .cs files by using the recommended header of PsCore (#930) (by @bergmeister)
- Update syntax in ReadMe to be the correct one from get-help (#932) by @bergmeister)
- Remove redundant, out of date Readme of RuleDocumentation folder (#918) (by @bergmeister)
- Shorten contribution section in ReadMe and make it more friendly (#911) (by @bergmeister)
- Update from Pester 4.1.1 to 4.3.1 and use new -BeTrue and -BeFalse operators (#906) (by @bergmeister)
- Fix Markdown in ScriptRuleDocumentation.md so it renders correctly on GitHub web site (#898) (Thanks @MWL88!)
- Fix typo in .Description for Measure-RequiresModules (#888) (Thanks @TimCurwick!)
- Use https links where possible (#873) (by @bergmeister)
- Make documentation of AvoidUsingPositionalParameters match the implementation (#867) (by @bergmeister)
- Fix PSAvoidUsingCmdletAliases warnings of internal build/release scripts in root and Utils folder (#872) (by @bergmeister)
- Add simple GitHub Pull Request template based off the one for PowerShell Core (#866) (by @bergmeister)
- Add a simple GitHub issue template based on the one of PowerShell Core. (#865, #884) (by @bergmeister)
- Fix Example 7 in Invoke-ScriptAnalyzer.md (#862) (Thanks @sethvs!)
- Use the typewriter apostrophe instead the typographic apostrophe (#855) (Thanks @alexandear!)
- Add justification to ReadMe (#848) (Thanks @KevinMarquette!)
- Fix typo in README (#845) (Thanks @misterGF!)

## [1.16.1](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.16.1) - 2017-09-01
### Fixed
- (#815) Formatter crashes due to invalid extent comparisons

## [1.16.0](https://github.com/PowerShell/PSScriptAnalyzer/tree/1.16.0) - 2017-08-15
### Added
- (#803) `CustomRulePath`, `RecurseCustomRulePath` and `IncludeDefaultRules` parameters to settings file.

Expand Down
Loading

0 comments on commit 3a3ff48

Please sign in to comment.