enables stylecheck (#40)

This commit is contained in:
Ben Bierens 2023-03-09 10:24:44 +01:00 committed by GitHub
parent 44c198b96a
commit 0cde8aeb67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -1,5 +1,7 @@
--threads:on --threads:on
--tlsEmulation:off --tlsEmulation:off
--styleCheck:usages
--styleCheck:error
when (NimMajor, NimMinor) == (1, 2): when (NimMajor, NimMinor) == (1, 2):
switch("hint", "Processing:off") switch("hint", "Processing:off")

View File

@ -18,7 +18,7 @@ push: {.upraises: [].}
type type
SQLiteDatastore* = ref object of Datastore SQLiteDatastore* = ref object of Datastore
readOnly: bool readOnly: bool
db: SQLiteDsDB db: SQLiteDsDb
proc path*(self: SQLiteDatastore): string = proc path*(self: SQLiteDatastore): string =
self.db.dbPath self.db.dbPath
@ -225,12 +225,12 @@ proc new*(
else: SQLITE_OPEN_READWRITE or SQLITE_OPEN_CREATE else: SQLITE_OPEN_READWRITE or SQLITE_OPEN_CREATE
success T( success T(
db: ? SQLIteDsDb.open(path, flags), db: ? SQLiteDsDb.open(path, flags),
readOnly: readOnly) readOnly: readOnly)
proc new*( proc new*(
T: type SQLiteDatastore, T: type SQLiteDatastore,
db: SQLIteDsDb): ?!T = db: SQLiteDsDb): ?!T =
success T( success T(
db: db, db: db,

View File

@ -12,7 +12,7 @@ export sqlite3_abi
# can pass `--forceBuild:on` to the Nim compiler if a SQLite build without # can pass `--forceBuild:on` to the Nim compiler if a SQLite build without
# `-DSQLITE_ENABLE_COLUMN_METADATA` option is stuck in the build cache, # `-DSQLITE_ENABLE_COLUMN_METADATA` option is stuck in the build cache,
# e.g. `nimble test --forceBuild:on` # e.g. `nimble test --forceBuild:on`
{.passC: "-DSQLITE_ENABLE_COLUMN_METADATA".} {.passc: "-DSQLITE_ENABLE_COLUMN_METADATA".}
push: {.upraises: [].} push: {.upraises: [].}
@ -44,7 +44,7 @@ proc bindParam(
n: int, n: int,
val: auto): cint = val: auto): cint =
when val is openarray[byte]|seq[byte]: when val is openArray[byte]|seq[byte]:
if val.len > 0: if val.len > 0:
# `SQLITE_TRANSIENT` "indicate[s] that the object is to be copied prior # `SQLITE_TRANSIENT` "indicate[s] that the object is to be copied prior
# to the return from sqlite3_bind_*(). The object and pointer to it # to the return from sqlite3_bind_*(). The object and pointer to it