1
0
mirror of https://github.com/j178/prek.git synced 2026-04-25 02:11:36 +02:00
Commit Graph

22 Commits

Author SHA1 Message Date
Copilot 752959ea20 Fix PowerShell completion instruction syntax (#1568)
The PowerShell completion instruction used bash-style environment
variable syntax (`COMPLETE=powershell prek`), which fails in PowerShell
with `CommandNotFoundException`.

## Changes

- Updated `docs/installation.md` to use PowerShell-native syntax for
setting environment variables

**Before:**
```powershell
Add-Content -Path $PROFILE -Value '(COMPLETE=powershell prek) | Out-String | Invoke-Expression'
```

**After:**
```powershell
Add-Content -Path $PROFILE -Value '$env:COMPLETE = "powershell"; prek | Out-String | Invoke-Expression; Remove-Item Env:\COMPLETE'
```

The fix sets `$env:COMPLETE` using PowerShell syntax, invokes `prek` to
generate the completion script, and cleans up the temporary environment
variable.

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Powershell completion script results in
CommandNotFoundException</issue_title>
> <issue_description>### Summary
> 
> Following the instructions for enabling Powershell shell completions,
I ran `Add-Content -Path $PROFILE -Value '(COMPLETE=powershell prek) |
Out-String | Invoke-Expression'`. This did what I expected it to: it
added a line to my $PROFILE, `(COMPLETE=powershell prek) | Out-String |
Invoke-Expression`.
> 
> However, also as expected, that line results in this error when the
profile loads (and, indeed, if one types that string at the prompt:
> ```
> COMPLETE=powershell : The term 'COMPLETE=powershell' is not recognized
as the name of a cmdlet, function, script file, or operable
> program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
> At
C:\Users\Patrick\OneDrive\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:357
char:2
> + (COMPLETE=powershell prek) | Out-String | Invoke-Expression
> +  ~~~~~~~~~~~~~~~~~~~
> + CategoryInfo : ObjectNotFound: (COMPLETE=powershell:String) [],
CommandNotFoundException
>     + FullyQualifiedErrorId : CommandNotFoundException
> ```
> 
> If the problem isn't apparent, perhaps someone can tell me what it's
designed to do so I can help? As a user of both Powershell & unix
shells, I wasn't able to figure out what the command is that we want
Powershell to run after glancing at some of the other completion
scripts.
> 
> ### Platform
> 
> Windows 10 x86_64
> 
> ### Version
> 
> prek 0.3.1 (bc142a25f 2026-01-31)
> 
> ### .pre-commit-config.yaml
> 
> not relevant
> 
> ### Log file
> 
> 2026-02-05T03:33:51.720707Z DEBUG prek: 0.3.1 (bc142a25f 2026-01-31)
> 2026-02-05T03:33:51.720806Z DEBUG Args: ["c:\\users\\username
\\.local\\bin\\prek.exe"]
> 2026-02-05T03:33:51.803464Z TRACE get_root: close time.busy=82.6ms
time.idle=5.10µs</issue_description>
> 
> <agent_instructions>Fix the powershell completion instruction in
installation.md: the style of running command with specified env var
`COMPLETE=powershell prek` is bash-style, it does not work in
powershell. Use something like `$env:COMPLETE = "powershell"; prek |
Out-String | Invoke-Expression; Remove-Item Env:\COMPLETE`
> </agent_instructions>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> <comment_new><author>@j178</author><body>
> Thanks for the report! That instruction isn’t correct. Could you try
adding this to your $PROFILE?
> 
> ```pwsh
> $env:COMPLETE = "powershell"
> prek | Out-String | Invoke-Expression
> Remove-Item Env:COMPLETE'
> ```</body></comment_new>
> </comments>
> 


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes j178/prek#1566

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
2026-02-05 12:11:38 +08:00
Shaan Majid 09f1a99947 docs(installation): miscellaneous cleanup (#1502)
Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2026-01-31 15:20:04 +08:00
Shaan Majid 7e1a49701c docs: add commands for artifact verification using GitHub Attestations (#1500)
Document how to verify release artifacts and Docker images using `gh
attestation verify`.

Refs: #1494, #1497
2026-01-31 13:34:54 +08:00
Kevin Gimbel 88c3c87954 Move docs to zensical (#1421)
* chore: slight formatting adjustments

* feat: use zensical

* chore: add uv to mise.toml

* docs: update snippets and snippet markers for includes

* chore: add prek to mise.toml; run prek

* fix: use snippet for changelog instead of symlink

Seems Zensical doesn't like symlinks, a snippet gets the same result

* chore: remove commented-out code

* chore: remove commented-out code; run prek
2026-01-20 19:44:15 +08:00
Matthias Schoettle 0784ddfaea Add mdformat pre-commit hook (#1416) 2026-01-20 11:26:37 +08:00
Jo c8b46885be Add docker integration docs (#1254) 2025-12-22 00:34:51 +08:00
Jo c3b833cd45 Add MacPorts to installation methods (#1157) 2025-11-26 17:35:48 +08:00
nblock 66f773afb4 Remove completion subcommand from shell completion docs (#1133) 2025-11-21 22:19:57 +08:00
Jo dc3d061e44 Add scoop to installation (#1067) 2025-11-12 19:09:02 +08:00
Louis Maddox 6d8579fdf4 feat: make package cargo binstallable (#882) 2025-10-15 06:33:38 +08:00
Colin Dean 0d91f4c39e Add Nix and Conda installation details (#874)
* Update README with Nix and Conda installation details

Progress toward #805

* Update docs/installation.md

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-10-14 11:50:05 +08:00
Álvaro Mondéjar Rubio ff3a6746ff Publish prek to npmjs.com (#819)
* Publish prek to npmjs.com

* Add some docs

* Fix error in README

* Put installation after cargo in README

* Update docs

* Update integration

* Minor change

* Minor change

* Use `@j178/prek`

* Use cargo-dist generated npm package

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2025-10-13 23:30:50 +08:00
Álvaro Mondéjar Rubio a95a3d0912 Deduplicate docs between README and MkDocs site (#792) 2025-09-25 11:28:29 +08:00
Jo 84da002275 Mention j178/prek-action in docs (#753)
Huge thanks to @frostming for creating prek-action and for generously handing it over to me!
2025-09-16 15:47:35 +08:00
Jo 224d7e6dae Bump version to 0.2.1 (#749) 2025-09-15 23:01:14 +08:00
Jo e3eeb39fd1 Bump version to 0.2.0 (#726) 2025-09-14 12:43:16 +08:00
Jo 98e0b71a61 Bump version to 0.2.0-alpha.5 (#711) 2025-09-11 10:52:26 +08:00
Jo d3825a1fad Bump version to 0.2.0-alpha.4 (#696)
* Revert "Remove setup-dev-drive from Windows CI (#674)"

This reverts commit f3111a4d29.

* Bump version to 0.2.0-alpha.4
2025-09-10 00:44:20 +08:00
Jo d5f2d6b303 Bump version to 0.2.0-alpha.3 (#671) 2025-09-08 15:21:24 +08:00
Jo 9fcc878a67 Update installer link 2025-09-07 16:22:43 +08:00
Jo 2ad6d1b2da Bump version to 0.2.0-alpha.1 (#640)
* Bump version to 0.2.0a1

* Fix version regex

* Update doc
2025-09-07 15:24:27 +08:00
Jo 5cbdeecccb Publish docs (#627) 2025-09-06 18:08:56 +08:00