Skip to content

Conversation

@ep0chzer0
Copy link

Summary

Fixes #1835

The inheritance printer was adding extraneous newline characters that caused inheritance information to be split across multiple lines when it should appear on a single line.

Before

+ Baz
 -> Bar, IBaz
, [Foo, IFoo]

After

+ Baz -> Bar, IBaz, [Foo, IFoo]

Changes

  • Remove trailing \n from contract name lines (e.g., info += blue(f"\n+ {child.name}\n")info += blue(f"\n+ {child.name}"))
  • Remove trailing \n from inheritance arrow lines
  • Remove trailing \n from not_immediate bracket lines
  • Remove trailing \n from section headers

Additional Fix

Also fixes a bug where base_to_child[base.name]["not_immediate"] was incorrectly populated with immediate values instead of not_immediate values.

Test Plan

  • Run slither test.sol --print inheritance with the test contract from the issue
  • Verify output is on single lines per contract

🤖 Generated with Claude Code

@ep0chzer0 ep0chzer0 requested a review from smonicas as a code owner January 16, 2026 11:34
@ep0chzer0
Copy link
Author

Hello maintainers! This is a simple fix for the inheritance printer output formatting issue. The extra newline characters were causing output to be split across lines incorrectly. Could you please approve the CI workflows to run? Thank you!

@ep0chzer0 ep0chzer0 force-pushed the fix/inheritance-printer-newlines branch from 7178e91 to 2c9f0ce Compare January 16, 2026 13:35
Remove extraneous newlines that caused inheritance information
to be split across multiple lines when it should appear on a single line.

Before:
```
+ Baz
 -> Bar, IBaz
, [Foo, IFoo]
```

After:
```
+ Baz -> Bar, IBaz, [Foo, IFoo]
```

Also fixes a bug where `not_immediate` contracts were incorrectly
populated with `immediate` values in the base_to_child results.

Fixes crytic#1835
@ep0chzer0 ep0chzer0 force-pushed the fix/inheritance-printer-newlines branch from 2c9f0ce to 661d4a7 Compare January 16, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inheritance printer adds unnecessary carriage return

1 participant