PowerShell / PowerShell/PSScriptAnalyzer

Add a pre-commit hook for psscriptanalyzer

Open
#1,969 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue - Question
Dominant language
C#
Stars
2.2k
Forks
414
Avg merge
13h 1m
Merged PRs (30d)
2

Description

it would be quite useful if I could use thehttps://pre-commit.com/tool to run PSScriptAnalyzer on my powershell scripts during the git commit stage. then I could find problems in my powershell code before they land into git repositories.

information how about to write a pre-commit hook can be found at https://pre-commit.com/#new-hooks
Proposed technical implementation details (optional)

for example, a pre-commit hook for pylint (the python linter) is at https://github.com/pylint-dev/pylint

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the pre-commit new-hooks documentation and the Pylint hook example linked in the issue. Determine how PSScriptAnalyzer should be exposed as a hook for PowerShell scripts; done means pre-commit can run it during commits and report analyzer problems before code is committed.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, powershell
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.