Skip to content

Releases: arnetheduck/nph

v0.7.0

16 Feb 17:13

Choose a tag to compare

What's Changed

0.7.0 brings several formatting changes to the table meaning that projects using
the earlier version wills see their code reformatted slightly - hopefully for the
better.

If you are checking formatting in CI, make sure to lock it down to the version
you're using locally and upgrade the two together!

Formatting updates:

  • Indent chained/dotted calls that start on a new line to make expression
    boundaries clear. Example:
    # old
    aaaa
    .f()
    .g()
    
    # new
    aaaa
      .f()
      .g()
  • Keep lightweight prefix calls (e.g., @, %, ?, not) on the same
    line as the assignment/opening when possible so lists and prefixed
    constructs don’t force an extra indent.
    # before
    let f2 =
      ?call(
        ...
      )
    
    # after
    let f2 = ?call(
      ...
    )
  • Put triple-string literals on same line if it fits
  • Make [] operator simple
  • Preserve block comments followed by single-line comments

New features:

  • --diff flag to show unified diff of formatting changes without modifying
    files
  • --color / --no-color flags for colored diff output (requires --diff)
  • .nph.toml config file support for project-level configuration
  • --exclude flag to replace default exclusion patterns
  • --extend-exclude flag to add patterns to default exclusions
  • --include flag to customize which files to format
  • --config flag to specify a custom config file
  • Default exclusion patterns for common directories (build, dist, .git,
    nimcache, etc.)
  • Files passed explicitly on CLI bypass all exclude filters (matching Black's
    behavior)
  • CLI options override config file settings
  • pre-commit integration support with nph hook

Full Changelog: v0.6.2...v0.7.0

Continuous prerelease

16 Feb 17:09

Choose a tag to compare

Continuous prerelease Pre-release
Pre-release
Changelog edits

v0.6.2

07 Dec 19:31
1c6d781

Choose a tag to compare

What's Changed

No formatting changes!

New Contributors

Full Changelog: v0.6.1...v0.6.2

v0.6.1

08 Jan 11:12
0d8000e

Choose a tag to compare

No formatting changes!

  • nimble compatibility updates (fixes nimble install nph sometimes)
  • osx arm64 binaries

v0.6.0

19 Jul 14:10

Choose a tag to compare

  • avoid putting , on its own line after complex expressions, where possible
  • allow compiling with a wider range of Nim 2.0 versions, hoping it won't break
  • a few bugfixes

v0.5.1

28 Feb 15:04

Choose a tag to compare

What's Changed

  • fix length computation of node with postifx comment (fixes #64) in #65

Full Changelog: v0.5...v0.5.1

v0.5

26 Feb 15:23

Choose a tag to compare

What's Changed

  • put overlong enum strings on new line (fixes #54) in #55
  • count = for proc / template / etc length (fixes #50) in #56
  • Allow function calls to partially fill RHS (fixes #52) in #58
  • extend trailing comma style to lists (fixes #57) in #59
  • allow first item in simple list to be complex (fixes #53) in #60
  • remove accentedName and surrounding cruft in #61
  • Make section postfix comment sticky at the right indent in #62
  • Add trailing comma at end of any long list (fixes #57) in #63

Full Changelog: v0.4.1...v0.5

v0.4.1

09 Feb 15:48

Choose a tag to compare

What's Changed

  • Update style examples for 0.4 in #48
  • fix missing comments after infix operator (fixes #47) in #49

Full Changelog: v0.4...v0.4.1

v0.4

05 Feb 10:55
537f1ce

Choose a tag to compare

What's Changed

  • .. and ..< gained spaces around them like all other infixes
  • chains of dot-calls get aligned
  • prefer putting things on a new line if this helps fit the whole expression
  • add . to simple expressions
  • fix several cases of over-indent
  • render infix expressions with operator ending the line where possible

New Contributors

Full Changelog: v0.3...v0.4

v0.3

04 Jan 16:04

Choose a tag to compare

  • Back to , as parameter separator - this helps compatibility with inline procs
  • 100% Nim compiler/stdlib compatibility
  • New manual at https://arnetheduck.github.io/nph/
  • Assorted bugfixes