Skip to content

Latest commit

 

History

History
112 lines (85 loc) · 2.92 KB

File metadata and controls

112 lines (85 loc) · 2.92 KB

Changelog

0.7.0

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

0.6.1

No formatting changes!

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

0.6.0

  • 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

0.5.1

  • fix a bug in the length computation of postfix-commented items
  • fix a bug in statement list expression rendering in calls
  • fix a bug in whitespace retention between calls

0.5

  • allow function calls to partially fill line in assignments
  • trailing commas also in simple multi-line lists
  • polish

0.4.1

  • fix comment-eating bug in infix

0.4

  • .. 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

0.3

  • 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

0.2

  • Initial versioned release
  • Comes with VSCode integration and 99% compatibibility