Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's not possible to ignore a comment that has multiple linter warning #865

Closed
achew22 opened this issue Jun 11, 2020 · 3 comments · Fixed by #866
Closed

It's not possible to ignore a comment that has multiple linter warning #865

achew22 opened this issue Jun 11, 2020 · 3 comments · Fixed by #866

Comments

@achew22
Copy link
Member

achew22 commented Jun 11, 2020

From https://github.com/bazelbuild/bazel-skylib/blob/2b38b2f8bd4b8603d610cfc651fcbb299498147f/rules/common_settings.bzl

# Copyright 2019 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Common build setting rules
These rules return a BuildSettingInfo with the value of the build setting.
For label-typed settings, use the native label_flag and label_setting rules.
More documentation on how to use build settings at
https://docs.bazel.build/versions/master/skylark/config.html#user-defined-build-settings
"""

the "common build settings rules" fails to lint for both a docstring and comment check. There doesn't appear to be a way to have two disable commands at the same time (I looked in the linter tests), and I tried:

# buildifier: disable=skylark-docstring
# buildifier: disable=skylark-comment

but it seems that only the later is applied to the block. I considered changing the URL, but it appears that it is a load bearing URL and Jekyl's redirect system is poor at best.

How should I proceed?

@vladmos
Copy link
Member

vladmos commented Jun 11, 2020

After #863 is merged, the warning shouldn't trigger anymore on the word "skylark" if it's a part of the link to the Starlark documentation. I'm merging it now, will make a new release containing it on Monday.

In your case adding # buildifier: disable=skylark-docstring should be enough, but I've just realized that the skylark-comment warning is triggered by that special comment, and by disabling one warning you get another. I'll look into it and will hopefully add the fix to the next release too.

@achew22
Copy link
Member Author

achew22 commented Jun 12, 2020

@vladmos do you mean it'll be released to the buildkite CI system on Monday?

@vladmos
Copy link
Member

vladmos commented Jun 12, 2020

Yes, it picks up the latest release of buildifier automatically.

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 a pull request may close this issue.

2 participants