Skip to content

Unused imports included in headers break build #268

Open
@chrisbenincasa

Description

@chrisbenincasa

Unused imports are included in the headers of generated files causing 2.12 builds with the default -Yfatal-warnings` setting to fail (unless the correct linting options are unset)

Expected behavior

Scrooge generates files with headers including only the imports the current file needs.

Actual behavior

Scrooge generates import statements for classes that are never used.

Steps to reproduce the behavior

Generate a simple class with the following Thrift

struct Simple {
  1: required string simple
}

Compiling with 2.12, with -Xfatal-warnings and -Xlint set, the build will fail.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions