Skip to content

fix silently fails to fix #1406

@maliberty

Description

@maliberty

-lint=fix doesn't fix an unused-variable silently leaving the impression there are no problems. If it fails it should print the lint=warn message.

Very trivial test case:

ALL_TESTS2 = COMPULSORY_TESTS
% buildifier --lint=warn  BUILD 
BUILD:1: unused-variable: Variable "ALL_TESTS2" is unused. Please remove it. (https://github.com/bazelbuild/buildtools/blob/main/WARNINGS.md#unused-variable)

% buildifier --lint=fix  BUILD 

% buildifier --lint=warn  BUILD 
BUILD:1: unused-variable: Variable "ALL_TESTS2" is unused. Please remove it. (https://github.com/bazelbuild/buildtools/blob/main/WARNINGS.md#unused-variable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2We'll consider working on this in future. (Assignee optional)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions