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

Silence kontrol build warnings #636

Merged
merged 8 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.327
0.1.328
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "kontrol"
version = "0.1.327"
version = "0.1.328"
description = "Foundry integration for KEVM"
authors = [
"Runtime Verification, Inc. <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion src/kontrol/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
if TYPE_CHECKING:
from typing import Final

VERSION: Final = '0.1.327'
VERSION: Final = '0.1.328'
7 changes: 7 additions & 0 deletions src/kontrol/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,13 @@ def parse(s: str) -> list[T]:
action='store_true',
help="Do not call 'forge build' during kompilation.",
)
build.add_argument(
'--no-silence-warnings',
dest='no_silence_warnings',
default=None,
action='store_true',
help='Do not silence K compiler warnings',
JuanCoRo marked this conversation as resolved.
Show resolved Hide resolved
)

state_diff_args = command_parser.add_parser(
'load-state-diff',
Expand Down
8 changes: 8 additions & 0 deletions src/kontrol/kompile.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def foundry_kompile(
if not options.no_forge_build:
foundry.build()

if not options.no_silence_warnings:
options.ignore_warnings = _silenced_warnings()

regen = options.regen
foundry_up_to_date = True

Expand Down Expand Up @@ -148,6 +151,7 @@ def update_kompilation_digest() -> None:
ccopts=options.ccopts,
debug=options.debug,
verbose=options.verbose,
ignore_warnings=options.ignore_warnings,
)

update_kompilation_digest()
Expand Down Expand Up @@ -192,3 +196,7 @@ def _foundry_to_main_def(
[_main_module] + modules,
requires=(KRequire(req) for req in list(requires)),
)


def _silenced_warnings() -> list[str]:
return ['non-exhaustive-match', 'missing-syntax-module']
2 changes: 2 additions & 0 deletions src/kontrol/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,13 +739,15 @@ class BuildOptions(LoggingOptions, KOptions, KGenOptions, KompileOptions, Foundr
regen: bool
rekompile: bool
no_forge_build: bool
no_silence_warnings: bool

@staticmethod
def default() -> dict[str, Any]:
return {
'regen': False,
'rekompile': False,
'no_forge_build': False,
'no_silence_warnings': False,
}

@staticmethod
Expand Down
Loading