Skip to content

Exclude out/lint from the Foundry.contracts property glob.#1127

Merged
automergerpr-permission-manager[bot] merged 3 commits intomasterfrom
anvacaru/bugfix
Mar 24, 2026
Merged

Exclude out/lint from the Foundry.contracts property glob.#1127
automergerpr-permission-manager[bot] merged 3 commits intomasterfrom
anvacaru/bugfix

Conversation

@anvacaru
Copy link
Contributor

@anvacaru anvacaru commented Mar 24, 2026

forge lint writes minimal artifacts that lack the AST section, causing the error below to always trigger on the second run, as the linter runs automatically.

"Must have 'ast' field in solc output. Make sure `ast = true` is present in `foundry.toml` and run `forge clean`

In this PR, I'm omitting all the contracts under out/lint as the artifacts are duplicated and not needed by kontrol.

Other Cleanups:

  • find_enums function definition is moved out of the loop, as originally it was re-created as a new function object on every iteration.
  • Eliminated str↔Path round-trip: glob results stay as Path objects throughout.
  • json_path.stem replaces split('/')[-1][:-5]: idiomatic and OS-safe.
  • Three list-comprehension passes collapsed into a single sorted() generator expression.
  • Added a default value for dct.get('nodes', []) in find_enums to avoid KeyError on leaf AST nodes.
  • Compute enum_max once and reuse instead of calling len(dct['members']) twice.

@anvacaru anvacaru requested a review from juliankuners March 24, 2026 13:55
@anvacaru anvacaru self-assigned this Mar 24, 2026
Copy link
Contributor

@juliankuners juliankuners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@automergerpr-permission-manager automergerpr-permission-manager bot merged commit c61ee54 into master Mar 24, 2026
9 checks passed
@automergerpr-permission-manager automergerpr-permission-manager bot deleted the anvacaru/bugfix branch March 24, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants