nim-lang / fusion

Fusion is for now an idea about how to grow Nim's ecosystem without the pain points of more traditional approaches.
MIT License
128 stars 16 forks source link

matching and tmatching trigger a ton of styleCheck hints #82

Open timotheecour opened 3 years ago

timotheecour commented 3 years ago

/cc @haxscramper

tests/tmatching.nim(1874, 11) Hint: 'doASsert' should be: 'doAssert' [Name]

a fix for this issue should also include this change:

switch("styleCheck", "hint")
=>
switch("styleCheck", "error")

in tests/config.nims

haxscramper commented 3 years ago

done

haxscramper commented 3 years ago

Using error not possible - stdlib fails.

  Compiling /home/runner/work/fusion/fusion/fusion/tests/tmatching (from package fusion) using c backend
Error: /home/runner/work/fusion/fusion/nim/lib/std/private/underscored_calls.nim(43, 21) Error: 'nnkArgList' should be: 'nnkArglist'
       Tip: 5 messages have been suppressed, use --verbose to show them.

https://github.com/nim-lang/fusion/pull/77/checks?check_run_id=2205625601#step:7:58

timotheecour commented 3 years ago

thanks!

Using error not possible - stdlib fails.

that's nasty, and relates to: https://github.com/nim-lang/Nim/pull/16176#issuecomment-737442088

IMO we should do the suggested fix there, and special-case stylecheck to allow both nnkArgList and nnkArglist, given that these are canonical:

nnkStmtList
nnkStmtListExpr
nnkStmtListType
nnkRecList
nkArgList (one n)
timotheecour commented 3 years ago

=> https://github.com/nim-lang/Nim/pull/17529

timotheecour commented 3 years ago

reopening, i did the mistake of writing unblocks nim-lang/fusion#77 which will fix nim-lang/fusion#82 so it aut-closed this unintendedly

@haxscramper please try again now that https://github.com/nim-lang/Nim/pull/17529 was merged (ideally in separate PR from https://github.com/nim-lang/fusion/pull/77 if possible to avoid conflating bug fixes and style changes)

if necessary, you could use

when (NimMajor, NimMinor, NimPatch) >= (1,5,1):
  switch("styleCheck", "error")