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

(maint) PowerShell Formatting #2799

Merged
merged 1 commit into from
Jan 6, 2023

Conversation

TheCakeIsNaOH
Copy link
Member

@TheCakeIsNaOH TheCakeIsNaOH commented Aug 18, 2022

Description Of Changes

PowerShell formatting changes according to PSSA settings in chocolatey/Chocolatey.Cake.Recipe#73.

Motivation and Context

Brings the PowerShell scripts to a consistent formatting baseline in this repository to prepare for #2703.

The chocolateyInstall.ps1 in the zip.template and msi.template packages included for the pester tests will give parsing errors, these will need to be excluded. The parsing errors are due to the tokens that are to be replaced when the template is used.

The tools directory also need to be excluded as it contains PowerShell scripts from various Cake modules/tools/addins/etc that should not be checked.

Testing

Ran Invoke-ScriptAnalyzer -Path . -Recurse -Settings "\path\to\Chocolatey.Cake.Recipe\Chocolatey.Cake.Recipe\Content\formatting-settings.psd1" to ensure that the PowerShell formatting is acceptable according to the agreed on settings.
Ran nunit and pester tests to ensure that nothing was broken.

Change Types Made

  • Bug fix (non-breaking change)
  • Feature / Enhancement (non-breaking change)
  • Breaking change (fix or feature that could cause existing functionality to change)
  • PowerShell code changes.
  • Maint

Related Issue

Formatting changes for #2703
Part of #13

Change Checklist

  • Requires a change to the documentation
  • Documentation has been updated
  • Tests to cover my changes, have been added
  • All new and existing tests passed.
  • PowerShell v2 compatibility checked.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 28.668% when pulling 1f2d60c on TheCakeIsNaOH:pssa-formatting into 1f34adf on chocolatey:develop.

vexx32
vexx32 previously approved these changes Sep 30, 2022
Copy link
Member

@vexx32 vexx32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! A few comments here and there. There's more we could do with these scripts going forward, but this is a great first step.

Thanks for the PR! 💖 😊

GenerateDocs.ps1 Outdated Show resolved Hide resolved
GenerateDocs.ps1 Outdated Show resolved Hide resolved
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gep13 gep13 merged commit d700d5c into chocolatey:develop Jan 6, 2023
@gep13
Copy link
Member

gep13 commented Jan 6, 2023

@TheCakeIsNaOH thanks for getting all of these fixed up!

@TheCakeIsNaOH TheCakeIsNaOH deleted the pssa-formatting branch January 6, 2023 15:14
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this pull request Jan 6, 2023
There were some changed code that was missed when chocolatey#2799 was rebased,
and was not reformatted.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this pull request Jan 13, 2023
There were some changed code that was missed when chocolatey#2799 was rebased,
and was not reformatted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants