From 0cde8aeb67c59fd0ac95496dc6b5e1168d6632aa Mon Sep 17 00:00:00 2001 From: Ben Bierens <39762930+benbierens@users.noreply.github.com> Date: Thu, 9 Mar 2023 10:24:44 +0100 Subject: [PATCH] enables stylecheck (#40) --- config.nims | 2 ++ datastore/sql/sqliteds.nim | 6 +++--- datastore/sql/sqliteutils.nim | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config.nims b/config.nims index 3b1dbb6..052a576 100644 --- a/config.nims +++ b/config.nims @@ -1,5 +1,7 @@ --threads:on --tlsEmulation:off +--styleCheck:usages +--styleCheck:error when (NimMajor, NimMinor) == (1, 2): switch("hint", "Processing:off") diff --git a/datastore/sql/sqliteds.nim b/datastore/sql/sqliteds.nim index a17d874..aa63274 100644 --- a/datastore/sql/sqliteds.nim +++ b/datastore/sql/sqliteds.nim @@ -18,7 +18,7 @@ push: {.upraises: [].} type SQLiteDatastore* = ref object of Datastore readOnly: bool - db: SQLiteDsDB + db: SQLiteDsDb proc path*(self: SQLiteDatastore): string = self.db.dbPath @@ -225,12 +225,12 @@ proc new*( else: SQLITE_OPEN_READWRITE or SQLITE_OPEN_CREATE success T( - db: ? SQLIteDsDb.open(path, flags), + db: ? SQLiteDsDb.open(path, flags), readOnly: readOnly) proc new*( T: type SQLiteDatastore, - db: SQLIteDsDb): ?!T = + db: SQLiteDsDb): ?!T = success T( db: db, diff --git a/datastore/sql/sqliteutils.nim b/datastore/sql/sqliteutils.nim index 267f548..bffb6e8 100644 --- a/datastore/sql/sqliteutils.nim +++ b/datastore/sql/sqliteutils.nim @@ -12,7 +12,7 @@ export sqlite3_abi # can pass `--forceBuild:on` to the Nim compiler if a SQLite build without # `-DSQLITE_ENABLE_COLUMN_METADATA` option is stuck in the build cache, # e.g. `nimble test --forceBuild:on` -{.passC: "-DSQLITE_ENABLE_COLUMN_METADATA".} +{.passc: "-DSQLITE_ENABLE_COLUMN_METADATA".} push: {.upraises: [].} @@ -44,7 +44,7 @@ proc bindParam( n: int, val: auto): cint = - when val is openarray[byte]|seq[byte]: + when val is openArray[byte]|seq[byte]: if val.len > 0: # `SQLITE_TRANSIENT` "indicate[s] that the object is to be copied prior # to the return from sqlite3_bind_*(). The object and pointer to it