Skip to content

Take Master changes to Development #170

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 72 commits into from
May 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
23cbc5b
Added script to build module
GoodOlClint May 7, 2015
ca4504b
Added waffle links for in progress and backlog items
raghushantha May 7, 2015
156b04d
Updated build version for the module
raghushantha May 7, 2015
1a14613
Check for VS Build tools
GoodOlClint May 7, 2015
2db0200
Specify build configuration and logging
GoodOlClint May 7, 2015
6a8fbe8
Corrected visual studio version name
GoodOlClint May 7, 2015
6de916f
Merge pull request #121 from PowerShell/UpdateModuleVersionBranch
raghushantha May 7, 2015
2fcfa4c
Merge pull request #128 from PowerShell/BugFixes
raghushantha May 8, 2015
b36c884
Update CHANGELOG.MD
raghushantha May 8, 2015
b3bab7e
Update CHANGELOG.MD
raghushantha May 8, 2015
19b7d2a
Added throughput graph
raghushantha May 11, 2015
7b968a7
Merge pull request #114 from GoodOlClint/buildcmd
raghushantha May 11, 2015
2d91cdb
Modify DSC rule severity
yutingc May 11, 2015
9cea2a8
Merge pull request #135 from PowerShell/dscServer
yutingc May 11, 2015
bf670a1
Update ReturnCorrectTypeDSCFunctions.md
yutingc May 11, 2015
f64e1ae
Update ProvideVerboseMessage.md
yutingc May 11, 2015
4b467f7
Update UseCmdletCorrectly.md
yutingc May 11, 2015
d03ffda
Update AvoidUsingPositionalParameters.md
yutingc May 11, 2015
9609bb1
Update UseDeclaredVarsMoreThanAssignments.md
yutingc May 11, 2015
7a29d19
Update UseShouldProcessCorrectly.md
yutingc May 11, 2015
9d20c22
Modified best practice.
yutingc May 11, 2015
515b7d8
Updated format
yutingc May 11, 2015
6c388d1
Add rule documentation for AvoidUsingCovertToSecureString
yutingc May 11, 2015
23fbab4
Update PowerShellBestPractices.md
yutingc May 11, 2015
8a675a7
Merge pull request #137 from PowerShell/BugFixes
yutingc May 11, 2015
c24e54b
Rename AvoidUsingConvertToSecureStringWithPlainTextNoViolations.md to…
yutingc May 11, 2015
c1d558d
Update AvoidUsingConvertToSecureStringWithPlainText.md
yutingc May 11, 2015
4e1a573
Update PowerShellBestPractices.md
yutingc May 11, 2015
12f937a
Merge pull request #136 from PowerShell/BestPractice
yutingc May 11, 2015
27298af
Rename CustomizedRuleDocumentation.md to ScriptRuleDocumentation.md
yutingc May 11, 2015
5b69c74
Add .gitignore file
yutingc May 12, 2015
ebddf80
Fix for including ProgressPreference built-in variable in the list of…
raghushantha May 12, 2015
30f434b
Added binplace location
yutingc May 12, 2015
e52216e
Forgot to import our module
raghushantha May 12, 2015
5d1dfa5
Merge pull request #145 from PowerShell/ProgressPreferenceFixBranch
raghushantha May 12, 2015
83f214a
Merge pull request #144 from PowerShell/gitignore
yutingc May 12, 2015
c8a5395
Fix severity ignore case bug
yutingc May 12, 2015
1778d2a
Merge pull request #148 from PowerShell/severityIgnoreCase
yutingc May 12, 2015
818108a
Suppress warnings emitted during the execution of Test-ModuleManifest
raghushantha May 12, 2015
efc027a
Merge pull request #149 from PowerShell/ModuleManifestBugFix
raghushantha May 12, 2015
231ba91
Update PowerShellBestPractices.md
KarolKaczmarek May 13, 2015
5f0c03a
Merge pull request #154 from KarolKaczmarek/patch-1
yutingc May 13, 2015
c05bcf2
Change the check to !isSingular() to avoid confusions
yutingc May 14, 2015
2cca80c
Added failing test for issue #158
GoodOlClint May 14, 2015
19d2c93
Correct PSAvoidDefaultTrueValueSwitchParameter rule to work with both…
GoodOlClint May 14, 2015
5f72980
Add failing test for #157
GoodOlClint May 14, 2015
76822d9
Suppress PSUseOutputTypeCorrectly warning when function outputs Syste…
GoodOlClint May 14, 2015
42a8f45
More robust method of detecting SwitchParameter types
GoodOlClint May 14, 2015
a30cd52
Merge pull request #155 from PowerShell/SingularNoun
yutingc May 14, 2015
8718dc5
Merge pull request #160 from GoodOlClint/PSUseOutputTypeCorrectly
yutingc May 14, 2015
82e9116
Merge pull request #159 from GoodOlClint/PSAvoidDefaultTrueValueSwitc…
yutingc May 14, 2015
71efc2b
Fix the uninitialized variable throw warning at preference variable
yutingc May 14, 2015
93aaa59
Add test changes
yutingc May 14, 2015
73375b1
Merge pull request #161 from PowerShell/UninitializedVariable
yutingc May 14, 2015
a9c752d
Merge branch 'BugFixes'
yutingc May 14, 2015
a6180eb
Merge branch 'master' into BugFixes
yutingc May 14, 2015
a74b7c4
Create appveyor.yml
raghushantha May 14, 2015
400fd78
Update README.md
raghushantha May 14, 2015
8a6e030
Update README.md
raghushantha May 14, 2015
2260344
Update appveyor.yml
raghushantha May 14, 2015
2544678
modify tests
yutingc May 14, 2015
b83765e
Update README.md
raghushantha May 14, 2015
039e46c
Merge pull request #163 from PowerShell/TestChanges
yutingc May 14, 2015
2282d53
Merge pull request #164 from PowerShell/BugFixes
yutingc May 14, 2015
0a6fef2
Update README.md
raghushantha May 14, 2015
c347cb7
Update README.md
raghushantha May 14, 2015
ba30af9
Merge pull request #162 from PowerShell/BuildStatus
raghushantha May 14, 2015
478206d
Update README.md
raghushantha May 14, 2015
23e70aa
Fixed crash in Script Rule discovery logic
raghushantha May 15, 2015
7599605
Added test for ScriptRule parsing crash bugfix
raghushantha May 15, 2015
616e570
Merge pull request #166 from PowerShell/ScriptRuleCrashFixBranch
raghushantha May 15, 2015
e76671a
Merge pull request #168 from PowerShell/BugFixes
raghushantha May 15, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
208 changes: 208 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/

# Visual Studo 2015 cache/options directory
.vs/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# DNX
project.lock.json
artifacts/

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding addin-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config

# Windows Azure Build Output
csx/
*.build.csdef

# Windows Store app package directory
AppPackages/

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
bower_components/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

##Our project binplace location
PSScriptAnalyzer/
5 changes: 3 additions & 2 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Unreleased (May.7, 2015)
## Released v1.0.1 (May.8, 2015)
###Features:
- Integrated with waffle.io for Project Management.
- Added documentation for writing script rules.
Expand All @@ -12,11 +12,12 @@

- PSProvideVerboseMessage only throws warnings in non-advanced functions.
- Fix the issue in importing customized rule
- Fix Function Member Ast cast error




##Relesed on Apr.24, 2015
##Released v1.0.0 on Apr.24, 2015

###Features:
- Finalized three levels of Severity - Error/Warning/Information.
Expand Down
2 changes: 1 addition & 1 deletion Engine/Commands/GetScriptAnalyzerRuleCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ protected override void ProcessRecord()
{
if (severity != null)
{
var ruleSeverity = severity.Select(item => Enum.Parse(typeof (RuleSeverity), item));
var ruleSeverity = severity.Select(item => Enum.Parse(typeof (RuleSeverity), item, true));
rules = rules.Where(item => ruleSeverity.Contains(item.GetSeverity())).ToList();
}

Expand Down
2 changes: 1 addition & 1 deletion Engine/Commands/InvokeScriptAnalyzerCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ private void AnalyzeFile(string filePath)

if (severity != null)
{
var diagSeverity = severity.Select(item => Enum.Parse(typeof(DiagnosticSeverity), item));
var diagSeverity = severity.Select(item => Enum.Parse(typeof(DiagnosticSeverity), item, true));
diagnostics = diagnostics.Where(item => diagSeverity.Contains(item.Severity)).ToList();
}

Expand Down
2 changes: 1 addition & 1 deletion Engine/PSScriptAnalyzer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Author = 'Microsoft Corporation'
RootModule = 'Microsoft.Windows.Powershell.ScriptAnalyzer.dll'

# Version number of this module.
ModuleVersion = '1.0'
ModuleVersion = '1.0.1'

# ID used to uniquely identify this module
GUID = '324fc715-36bf-4aee-8e58-72e9b4a08ad9'
Expand Down
6 changes: 6 additions & 0 deletions Engine/ScriptAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ public List<ExternalRule> GetExternalRule(string[] moduleNames)
string script = string.Format(CultureInfo.CurrentCulture, "Get-Module -Name '{0}' -ListAvailable", moduleName);
shortModuleName = posh.AddScript(script).Invoke<PSModuleInfo>().First().Name;

// Invokes Update-Help for this module
// Required since when invoking Get-Help later on, the cmdlet prompts for Update-Help interactively
// By invoking Update-Help first, Get-Help will not prompt for downloading help later
script = string.Format(CultureInfo.CurrentCulture, "Update-Help -Module '{0}' -Force", shortModuleName);
posh.AddScript(script).Invoke();

// Invokes Get-Command and Get-Help for each functions in the module.
script = string.Format(CultureInfo.CurrentCulture, "Get-Command -Module '{0}'", shortModuleName);
var psobjects = posh.AddScript(script).Invoke();
Expand Down
7 changes: 5 additions & 2 deletions Engine/SpecialVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ static SpecialVars()
internal const string WhatIfPreference = "WhatIfPreference";
internal const string WarningPreference = "WarningPreference";
internal const string ConfirmPreference = "ConfirmPreference";
internal const string ProgressPreference = "ProgressPreference";

internal static readonly string[] PreferenceVariables = new string[]
{
Expand All @@ -99,7 +100,8 @@ static SpecialVars()
ErrorActionPreference,
WhatIfPreference,
WarningPreference,
ConfirmPreference,
ConfirmPreference,
ProgressPreference
};

internal static readonly Type[] PreferenceVariableTypes = new Type[]
Expand All @@ -109,7 +111,8 @@ static SpecialVars()
/* ErrorPreference */ typeof(ActionPreference),
/* WhatIfPreference */ typeof(SwitchParameter),
/* WarningPreference */ typeof(ActionPreference),
/* ConfirmPreference */ typeof(ConfirmImpact),
/* ConfirmPreference */ typeof(ConfirmImpact),
/* ProgressPreference */ typeof(Enum),
};

internal enum AutomaticVariable
Expand Down
3 changes: 2 additions & 1 deletion Engine/VariableAnalysis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ public bool IsUninitialized(VariableExpressionAst varTarget)
}

return analysis.DefinedBlock == null
&& !SpecialVars.InitializedVariables.Contains(analysis.Name, StringComparer.OrdinalIgnoreCase)
&& !(SpecialVars.InitializedVariables.Contains(analysis.Name, StringComparer.OrdinalIgnoreCase) ||
SpecialVars.InitializedVariables.Contains(analysis.RealName, StringComparer.OrdinalIgnoreCase))
&& !IsGlobalOrEnvironment(varTarget);
}

Expand Down
Loading