bazelbuild / bazelbuild/bazel

Add support for comments in .bazelignore files

Open
#19,821 0 comments 1 reaction 0 assignees View on GitHub
help wanted P2 team-OSS type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

### Description of the feature request:

It would be nice if it would be possible to use comments in `.bazelignore` files, e.g.

```
ree/acceptance_tests/ # has its own MODULE.bazel file
third_party # ignore third-party folder
```

Currently, line 1 is interpreted by Bazel as "ignore folder that is `named ree/acceptance_tests/ # has its own MODULE.bazel file`", i.e. it considers the comment as a part of the path name to ignore.

Since `#` works as a comment in `BUILD(.build)`, `WORKSPACE(.bazel)`, `MODULE.bazel`, `.bazelrc` etc. it would be nice if it would also work for `.bazelignore` files

### What underlying problem are you trying to solve with this feature?

Be able to write down some description why something is ignored

### Which operating system are you running Bazel on?

macOS, Windows, Ubuntu

### What is the output of `bazel info release`?

8.5.0

Contributor guide

Open the contributing guide

Research direction

Start by locating Bazel’s .bazelignore reader and any existing tests for ignore-file parsing. Confirm how inline # text is currently treated, then add coverage for the examples so comments are accepted while the intended paths remain ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.