Skip to content

Commit

Permalink
rm some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek committed Mar 4, 2024
1 parent 3b00075 commit 150d42b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 16 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,30 +108,24 @@ jobs:
NIMSKULL_BIN: ${{ steps.nimskull.outputs.bin-path }}

# - name: Valgrind
# shell: bash
# run: |
# sudo apt-get update
# sudo apt install --fix-missing valgrind

- name: Dependencies
shell: bash
run: |
nimble --accept install "https://github.com/disruptek/balls"
nimble --accept develop
env:
NIM: ${{ matrix.compiler.name }}

- name: Tests
shell: bash
run: |
cd project
balls --path='.' --path='$nim' --backend:c --gc:arc --gc:orc
balls --path='.' --path='$nim' --backend:c --gc:arc --gc:orc
- name: Build Docs
if: ${{ matrix.docs }} == 'true'
shell: bash
run: |
cd project
branch=${{ github.ref }}
branch=${branch##*/}
nimble doc --project --path="." --outdir:docs \
Expand Down
4 changes: 1 addition & 3 deletions tests/tcompiler.nim → tests/tcompilers.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import std/options

import ups/compiler
import ups


let vnim = """Nim Compiler Version 2.1.1 [Linux: amd64]
Expand All @@ -17,8 +17,6 @@ Source hash: 4948ae809f7d84ef6d765111a7cd0c7cf2ae77d2
Source date: 2024-02-18
"""

var nv: CompilerVersion

block:
let nv = parseCompilerVersion vnim
doAssert nv.isSome
Expand Down
11 changes: 10 additions & 1 deletion ups.nim
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
import ups/config
import ups/versions
import ups/compilers
import ups/sanitize
import ups/runner
export versions, compilers, sanitize, runner

# TODO
when not defined(isNimSkull):
import ups/config
export config
File renamed without changes.
2 changes: 1 addition & 1 deletion ups/config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ proc getAllLockerRooms*(js: JsonNode): JsonNode =
if not js.isEmpty and js.kind == JObject:
if $LockerRooms in js:
result = js[$LockerRooms]
break
break found
result = newJObject()

proc getLockerRoom*(js: JsonNode; name: string): JsonNode =
Expand Down
8 changes: 4 additions & 4 deletions ups/spec.nim
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,16 @@ proc importName*(url: Uri): ImportName =

proc forkTarget*(url: Uri): ForkTargetResult =
result.url = normalizeUrl url
block success:
block failure:
if not result.url.isValid:
result.why = "url is invalid"
break
break failure
if not result.url.isGitHub:
result.why = "url $# does not point to github" % [ $result.url ]
break
break failure
if result.url.path.len < 1:
result.why = "unable to parse url $#" % [ $result.url ]
break
break failure
# split /foo/bar into (bar, foo)
let start = if result.url.path.startsWith("/"): 1 else: 0
(result.owner, result.repo) = result.url.path[start..^1].splitPath
Expand Down
2 changes: 2 additions & 0 deletions ups/versions.nim
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ proc `$`*(v: Version): string =
result.add '.'
result.add $v.patch

{.push warning[ImplicitDefaultValue]: off.}
proc bumpVersion*(ver: Version; major, minor, patch = false): Option[Version] =
## increment the version by the specified metric;
## returns none() if no bump occurred
Expand All @@ -78,6 +79,7 @@ proc bumpVersion*(ver: Version; major, minor, patch = false): Option[Version] =
result = some: Version (ver.major, ver.minor + 1'u, 0'u)
elif patch:
result = some: Version (ver.major, ver.minor, ver.patch + 1'u)
{.pop.}

template starOrDigits(s: string): VersionMaskField =
## parse a star or digit as in a version mask
Expand Down

0 comments on commit 150d42b

Please sign in to comment.