nph icon indicating copy to clipboard operation
nph copied to clipboard

An opinionated code formatter for Nim

Results 16 nph issues
Sort by recently updated
recently updated
newest added

It would be nice to provide an action for Github Action for `nph` so it can be automatically checked in CI. Examples from Rust: - `cargo fmt`: https://github.com/privacy-scaling-explorations/halo2curves/blob/9fff22c/.github/workflows/ci.yml#L84-L97 using this...

command: nph nim-libp2p/tests/testutility.nim output: ``` --- Input --- {.used.} # Nim-Libp2p # Copyright (c) 2023 Status Research & Development GmbH # Licensed under either of # * Apache License, version...

Since black for Python I started to love opinionated formatters. And I was sooo hoping that somebody would create one for Nim. Thank you! (Nim pretty does just not feel...

Tried to format code: ```nim type InitSystemTrait = concept s s.init() Test = object ``` It was turned to: ```nim type InitSystemTrait = concept s s.init() Test = object ```...

### Nim version ``` $ nim -v Nim Compiler Version 2.2.0 [Linux: amd64] Compiled at 2024-10-02 Copyright (c) 2006-2024 by Andreas Rumpf git hash: 78983f1876726a49c69d65629ab433ea1310ece1 active boot switches: -d:release ```...

formating this: ```nim proc getWorkspaceConfiguration*(ls: LanguageServer): Future[NlsConfig] {.async: (raises: []).} = ``` results in this: ```nim proc getWorkspaceConfiguration*( ls: LanguageServer ): Future[NlsConfig] {.async: (raises: []).} = ``` The closing parens...

```nim x.add (func1 do: x)[0] ``` ``` --- Input --- x.add (func1 do: x)[0] --- Formatted --- x.add func1 do: x[0] --- PRE --- kind: "nkBracketExpr" sons: - kind: "nkCall"...

```nim const keywords = collect(for it in Keyword: $it) ``` Expands to: ```nim const keywords = collect( for it in Keyword: $it ) ``` I don't think it's ideal. nph...

# Problem The formatting is both ugly and throws off VSCode's Nim extension's code highlighting for "emitted" code. # Version ❯ nph -v v0.6.1-0-g0d8000e # Examples ```nim const foo =...