{"id":15064021,"url":"https://github.com/ophiosdev/pre-commit-psscriptanalyzer","last_synced_at":"2026-03-06T19:33:53.847Z","repository":{"id":255224146,"uuid":"848852377","full_name":"ophiosdev/pre-commit-psscriptanalyzer","owner":"ophiosdev","description":"pre-commit hooks for linting and formatting PowerShell code via PSScriptAnalyzer","archived":false,"fork":false,"pushed_at":"2024-08-28T16:45:00.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T17:11:19.297Z","etag":null,"topics":["powershell","pre-commit","pre-commit-ci","pre-commit-config","pre-commit-hook","pre-commit-hooks"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ophiosdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-28T14:21:10.000Z","updated_at":"2024-12-03T17:59:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"abf2877c-81a3-4b34-ac10-983a23894c99","html_url":"https://github.com/ophiosdev/pre-commit-psscriptanalyzer","commit_stats":null,"previous_names":["ophiosdev/pre-commit-psscriptanalyzer"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ophiosdev/pre-commit-psscriptanalyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ophiosdev%2Fpre-commit-psscriptanalyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ophiosdev%2Fpre-commit-psscriptanalyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ophiosdev%2Fpre-commit-psscriptanalyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ophiosdev%2Fpre-commit-psscriptanalyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ophiosdev","download_url":"https://codeload.github.com/ophiosdev/pre-commit-psscriptanalyzer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ophiosdev%2Fpre-commit-psscriptanalyzer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30193649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["powershell","pre-commit","pre-commit-ci","pre-commit-config","pre-commit-hook","pre-commit-hooks"],"created_at":"2024-09-25T00:10:20.746Z","updated_at":"2026-03-06T19:33:53.823Z","avatar_url":"https://github.com/ophiosdev.png","language":"PowerShell","readme":"# pre-commit-psscriptanalyzer\n\n![Pre-Commit](https://github.com/ophiosdev/pre-commit-psscriptanalyzer.git/actions/workflows/pre-commit.yml/badge.svg)\n\nThis project provides [pre-commit](https://pre-commit.com/) hooks to lint and\nformat PowerShell code, using the\n[PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer/) static code\nchecker.\n\n## Setup\n\nTo activate the hooks, add the following lines to the `repos` list in the\nproject's `.pre-commit-config.yaml` file:\n\n```yaml\n---\nrepos:\n  - repo: https://github.com/ophiosdev/pre-commit-psscriptanalyzer.git\n    rev: v2.0.0\n    hooks:\n      # Check PowerShell code\n      - id: psscriptanalyzer-check\n      # Format PowerShell code\n      - id: psscriptanalyzer-format\n```\n\nThese hooks require [PowerShell](https://learn.microsoft.com/powershell/scripting/install/installing-powershell) to run.\n\nAlternatively use this to run the hooks with Docker (so no dependency on\nPowerShell is needed):\n\n```yaml\n---\nrepos:\n  - repo: https://github.com/ophiosdev/pre-commit-psscriptanalyzer.git\n    rev: v2.0.0\n    hooks:\n      # Check PowerShell code\n      - id: psscriptanalyzer-check-docker\n      # Format PowerShell code\n      - id: psscriptanalyzer-format-docker\n```\n\n## Supported hooks\n\n### psscriptanalyzer-check\n\nThe `psscriptanalyzer-check` hook performs checks on PowerShell code, based on\n[selected best practice\nrules](https://github.com/PowerShell/PSScriptAnalyzer/tree/master/docs/Rules).\nIt supports the following options from the PSScriptAnalyzer function\n[`Invoke-ScriptAnalyzer`](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-scriptanalyzer):\n\n* [`-CustomRulePath`](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-scriptanalyzer#-customrulepath)\n* [`-ExcludeRule`](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-scriptanalyzer#-excluderule)\n* [`-Fix`](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-scriptanalyzer#-fix)\n* [`-IncludeDefaultRules`](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-scriptanalyzer#-includedefaultrules)\n* [`-IncludeRule`](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-scriptanalyzer#-includerule)\n* [`-IncludeSuppressed`](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-scriptanalyzer#-includesuppressed)\n* [`-RecurseCustomRulePath`](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-scriptanalyzer#-recursecustomrulepath)\n* [`-SaveDscDependency`](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-scriptanalyzer#-savedscdependency)\n* [`-Settings`](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-scriptanalyzer#-settings)\n* [`-Severity`](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-scriptanalyzer#-severity)\n\nThe `psscriptanalyzer-check-docker` hook supports the same options.\n\nTo pass multiple values like to the `-ExcludeRule` parameter, create a\n**single** string where the values are separated by a `,` (comma) **without**\nany whitespaces\n\n```yaml\n---\nrepos:\n  - repo: https://github.com/ophiosdev/pre-commit-psscriptanalyzer.git\n    rev: v2.0.0\n    hooks:\n      # Check PowerShell code\n      - id: psscriptanalyzer-check\n        args:\n          - '-ExcludeRule'\n          - 'PSAvoidUsingConvertToSecureStringWithPlainText,PSAvoidUsingWriteHost'\n```\n\n### psscriptanalyzer-format\n\nThe `psscriptanalyzer-format` formats PowerShell code to a canonical format. It\nsupports the following options from the PSScriptAnalyzer function\n[`Invoke-Formatter`](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-formatter)\n:\n\n* [`-Range`](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-formatter#-range)\n* [`-Settings`](https://learn.microsoft.com/en-us/powershell/module/psscriptanalyzer/invoke-formatter#-settings)\n\nThe `psscriptanalyzer-format-docker` hook supports the same options.\n\n## Copyright and license\n\n© 2023 Mohamed El Morabity\n© 2024 Ophios GmbH\n\nLicensed under the [GNU GPL, version 3.0 or later](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fophiosdev%2Fpre-commit-psscriptanalyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fophiosdev%2Fpre-commit-psscriptanalyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fophiosdev%2Fpre-commit-psscriptanalyzer/lists"}