nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.58k stars 1.47k forks source link

nimpretty fails `invalid indentention` when using semicolon #21676

Closed noahehall closed 1 year ago

noahehall commented 1 year ago

Description

this is valid syntax as the file runs

# the issue is the `;`
# all fail
mutable.apply x => x * x; echoMutated()
mutable.apply(x => x * x); echoMutated()
mutable.apply(x => x * x);

# but this works fine
mutable.apply x => x * x
echoMutated()

Nim Version

$ nim -v
Nim Compiler Version 1.9.3 [Linux: amd64]
Compiled at 2023-04-08
Copyright (c) 2006-2023 by Andreas Rumpf

active boot switches: -d:release

$ nim_c_current 
  Selected: #version-2-0
   Channel: stable
      Path: /home/poop/.choosenim/toolchains/nim-#version-2-0

  Versions:  
            #devel
            1.6.12
            1.6.10
          * #version-2-0

Current Output

06:21 PM (nimv2-finale *$) 
$ nimpretty src/**/**/*.nim
bookofnim/src/bookofnim/deepdives/collections.nim(91, 25) Error: invalid indentation

Expected Output

the file runs, so i assumed nimpretty would format files according to the styleguide

Possible Solution

remove the semicolon, and remember to start the project with a nimpretty githook setup

Additional Information

No response

noahehall commented 1 year ago

ignore, nimpretty pretty much requires this feature request