Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matching and tmatching trigger a ton of styleCheck hints #82

Open
timotheecour opened this issue Mar 26, 2021 · 5 comments
Open

matching and tmatching trigger a ton of styleCheck hints #82

timotheecour opened this issue Mar 26, 2021 · 5 comments

Comments

@timotheecour
Copy link
Member

/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
Copy link
Contributor

done

@haxscramper
Copy link
Contributor

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
Copy link
Member Author

thanks!

Using error not possible - stdlib fails.

that's nasty, and relates to: nim-lang/Nim#16176 (comment)

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
Copy link
Member Author

=> nim-lang/Nim#17529

@timotheecour
Copy link
Member Author

timotheecour commented Mar 27, 2021

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 nim-lang/Nim#17529 was merged (ideally in separate PR from #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")

Araq pushed a commit that referenced this issue Jun 3, 2021
…efault>` implementation (#77)

* [TEST]

* [TEST] More tests

* [FIX] #76

* [TEST] String length test

* [DOC] Spec for `opt`

* [DOC] `doc` interaction with `any`

* [DOC] Scale back `opt` features

* [CHECKPOINT] Initial `opt` implementation

* [FEATURE] `opt` implementation

- ADDED ::
  - implement `opt` for field access

* [FIX] Additional check for `nil` values

- CHANGED ::
  Before calling check function on nested match element check using
  `isNil` if entry can is correct. This avoids almost unfixable
  nil-based exceptions triggered deeply within pattern.

* [CLEAN] Internal naming cleanup

- CHANGED ::
  - Use more readable, unabreviated field names (cnt -> foundCount,
    fldElems -> fieldElements)

* [FIX] make style check shut the fuck up

* [FIX] Also bitch with error on typos

* [FIX] oh no, stdlib does not pass style check

 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.

* [DOC]

* [FIX] Support qualified variant selectors with matching? #83

* [CLEAN] debug prints

* [TEST] Decision matrix predicate test

* [DOC] Predicates and infix operators

* [FIX] Use peg instead of regex for example test

* [FIX] Duplicate assign for matches with conditions

* [CHECKPOINT]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants