I am using the latest buildifier to check Bazel files in a project with bzlmod enabled.
> ls -1
BUILD.bazel
MODULE.bazel
MODULE.bazel.lock
src
It appears to me that buildifier's linter incorrectly detects the type of MODULE.bazel files. There is a module-docstring violations in this file but buildifier reports nothing:
However, if the type is set to default explicitly, it works fine:
> buildifier --mode=check --lint=warn --type=default MODULE.bazel
MODULE.bazel:1: module-docstring: The file has no module docstring.
A module docstring is a string literal (not a comment) which should be the first statement of a file (it may follow comment lines). (https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#module-docstring)
At the same time, formatting is still detected without setting --type=default:
I am using the latest
buildifier
to check Bazel files in a project with bzlmod enabled.It appears to me that
buildifier
's linter incorrectly detects the type ofMODULE.bazel
files. There is amodule-docstring
violations in this file butbuildifier
reports nothing:However, if the type is set to
default
explicitly, it works fine:At the same time, formatting is still detected without setting
--type=default
:Am I missing something or there is an issue with
buildifier
?The version of
buildifier
used: