stylecheck: nnkArglist -> nnkArgList (#127)

* stylecheck: nnkArglist -> nnkArgList

* --stylecheck:error iff >= 1.6.0
This commit is contained in:
tersec 2022-07-18 11:02:40 +00:00 committed by GitHub
parent 9a3130eb5b
commit f173efc500
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 148 additions and 12 deletions

View File

@ -12,9 +12,19 @@ requires "nim >= 1.2.0",
### Helper functions
proc test(args, path: string) =
# nnkArglist was changed to nnkArgList, so can't always use --styleCheck:error
# https://github.com/nim-lang/Nim/pull/17529
# https://github.com/nim-lang/Nim/pull/19822
let styleCheckStyle =
if (NimMajor, NimMinor) < (1, 6):
"hint"
else:
"error"
# Compilation language is controlled by TEST_LANG
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") & " " & args &
" -r --hints:off --skipParentCfg --styleCheck:usages --styleCheck:error " & path
exec "nim " & getEnv("TEST_LANG", "c") & " " & getEnv("NIMFLAGS") & " " &
args & " -r --hints:off --skipParentCfg --styleCheck:usages --styleCheck:" &
styleCheckStyle & " " & path
task test, "Run all tests":
test "--threads:off", "tests/all_tests"

View File

@ -412,7 +412,7 @@ macro unpackArgs*(callee: untyped, args: untyped): untyped =
for arg in args:
let arg = if arg.kind == nnkHiddenStdConv: arg[1]
else: arg
if arg.kind == nnkArglist:
if arg.kind == nnkArgList:
for subarg in arg:
result.add subarg
else:

View File

@ -1,5 +1,5 @@
# stew
# Copyright 2018-2019 Status Research & Development GmbH
# Copyright 2018-2022 Status Research & Development GmbH
# Licensed under either of
#
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)

View File

@ -1,2 +1,4 @@
{.used.}
import
ttypedranges, tstackarrays, tbitranges

View File

@ -1,3 +1,11 @@
# Copyright (c) 2019-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license: http://opensource.org/licenses/MIT
# * Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import
random, unittest2,
../../stew/ranges/bitranges, ../../stew/bitseqs

View File

@ -1,3 +1,11 @@
# Copyright (c) 2019-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license: http://opensource.org/licenses/MIT
# * Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import
unittest2, math,
../../stew/ptrops,

View File

@ -1,3 +1,11 @@
# Copyright (c) 2019-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license: http://opensource.org/licenses/MIT
# * Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import
unittest2, sets,
../../stew/ranges/[typedranges, ptr_arith]

View File

@ -1,3 +1,11 @@
# Copyright (c) 2020-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license: http://opensource.org/licenses/MIT
# * Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import
unittest2,
../stew/assign2

View File

@ -1,3 +1,11 @@
# Copyright (c) 2019-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license: http://opensource.org/licenses/MIT
# * Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import unittest2
import ../stew/bitops2

View File

@ -1,3 +1,11 @@
# Copyright (c) 2019-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license: http://opensource.org/licenses/MIT
# * Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import
unittest2, strformat,
../stew/[bitseqs]

View File

@ -1,10 +1,12 @@
# byteutils
# Copyright (c) 2018 Status Research & Development GmbH
# Copyright (c) 2018-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import
unittest2,
../stew/byteutils

View File

@ -1,3 +1,11 @@
# Copyright (c) 2020-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license: http://opensource.org/licenses/MIT
# * Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import unittest2
import ../stew/ctops

View File

@ -1,3 +1,11 @@
# Copyright (c) 2019-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license: http://opensource.org/licenses/MIT
# * Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import unittest2
import ../stew/endians2

View File

@ -1,6 +1,6 @@
# Nimbus - Types, data structures and shared utilities used in network sync
#
# Copyright (c) 2018-2021 Status Research & Development GmbH
# Copyright (c) 2018-2022 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
# http://www.apache.org/licenses/LICENSE-2.0)
@ -9,6 +9,8 @@
# at your option. This file may not be copied, modified, or
# distributed except according to those terms.
{.used.}
import
unittest2,
../stew/interval_set

View File

@ -1,3 +1,11 @@
# Copyright (c) 2020-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license: http://opensource.org/licenses/MIT
# * Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import unittest2
import ../stew/io2

View File

@ -1,5 +1,5 @@
# Nimbus
# Copyright (c) 2018-2019 Status Research & Development GmbH
# Copyright (c) 2018-2022 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
# http://www.apache.org/licenses/LICENSE-2.0)
@ -8,6 +8,8 @@
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
{.used.}
import
std/[algorithm, sequtils, strformat, strutils, tables],
unittest2,

View File

@ -1,8 +1,15 @@
# Copyright (c) 2020-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license: http://opensource.org/licenses/MIT
# * Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import
unittest2,
../stew/shims/macros
template unknown() {.pragma.}
template zero() {.pragma.}
template one(one: string) {.pragma.}

View File

@ -1,5 +1,5 @@
# stew
# Copyright 2018-2019 Status Research & Development GmbH
# Copyright 2018-2022 Status Research & Development GmbH
# Licensed under either of
#
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
@ -7,6 +7,8 @@
#
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import unittest2
import ../stew/ptrops

View File

@ -1,3 +1,5 @@
{.used.}
# nim-result is also available stand-alone from https://github.com/arnetheduck/nim-result/
import ../stew/results

View File

@ -1,10 +1,12 @@
# byteutils
# Copyright (c) 2018 Status Research & Development GmbH
# Copyright (c) 2018-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import
unittest2,
../stew/sequtils2

View File

@ -1,3 +1,11 @@
# Copyright (c) 2021-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license: http://opensource.org/licenses/MIT
# * Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import
unittest2,
../stew/shims/sets

View File

@ -1,5 +1,5 @@
# Nimbus
# Copyright (c) 2018-2019 Status Research & Development GmbH
# Copyright (c) 2018-2022 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
# http://www.apache.org/licenses/LICENSE-2.0)
@ -8,6 +8,8 @@
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
{.used.}
import
std/[algorithm, sequtils, strformat, tables],
../stew/sorted_set,

View File

@ -1,3 +1,11 @@
# Copyright (c) 2021-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license: http://opensource.org/licenses/MIT
# * Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import
unittest2,
../stew/templateutils

View File

@ -1,3 +1,11 @@
# Copyright (c) 2019-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license: http://opensource.org/licenses/MIT
# * Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import
unittest2, random,
../stew/[varints, byteutils]

View File

@ -1,5 +1,12 @@
# Copyright (c) 2020-2022 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license: http://opensource.org/licenses/MIT
# * Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.used.}
import unittest2
import ../stew/io2
when defined(windows):
import ../stew/windows/acl