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

🐛 gitignore lines starting with / not parsed correctly #805

Closed
1 task done
abustany opened this issue Nov 20, 2023 · 7 comments · Fixed by #1134
Closed
1 task done

🐛 gitignore lines starting with / not parsed correctly #805

abustany opened this issue Nov 20, 2023 · 7 comments · Fixed by #1134
Labels
A-Project Area: project S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@abustany
Copy link

Environment information

CLI:
  Version:                      1.3.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.9.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/8.10.2"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              true
  Organize imports disabled:    false
  VCS disabled:                 false

Workspace:
  Open Documents:               0

What happened?

  1. Setup a .gitignore file in a subfolder with an absolute path in it (see example below) and enable gitignore integration
  2. Run biome format

biome.json

{
  "$schema": "https://biomejs.dev/schemas/1.3.3/schema.json",
  "formatter": {
    "enabled": true,
    "indentStyle": "space",
    "indentWidth": 2,
    "lineWidth": 120
  },
  "vcs": {
    "enabled": true,
    "clientKind": "git",
    "useIgnoreFile": true
  }
}

app/.gitignore

# The "/" here means that the pattern is "anchored" in /app, ie app/build is ignored but app/foo/build is not
/build

Expected result

Biome should ignore the file, but the file is not ignored.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@Conaclos Conaclos added A-Project Area: project S-Bug-confirmed Status: report has been confirmed as a valid bug labels Nov 21, 2023
@sairion
Copy link

sairion commented Dec 5, 2023

This is pretty annoying, make me to separately declare ignore config in each packages of monorepo

@malobre
Copy link
Contributor

malobre commented Dec 5, 2023

@sairion FYI, ignoring ./file should behave the same as ignoring /file. Just a temporary workaround.

@DanielNoord
Copy link

DanielNoord commented Jul 23, 2024

@ematipico I see in #1134 that support for this was reverted in #1249 but I don't see a new issue or new PR. Is there somewhere I can track support for this?

@ematipico
Copy link
Member

No, there isn't

@DanielNoord
Copy link

Can we reopen this one?

@ematipico
Copy link
Member

ematipico commented Jul 23, 2024

Can we reopen this one?

It's not a bug because we don't support nested .gitignore files. We attempted to do that and we failed. (As you noticed)

We will attempt to do that later once we will add more features to our CLI, but that's not in our high priority list at the moment. Feel free to open a discussion so it attracts upvotes

@DanielNoord
Copy link

Opened a discussion here: #3530

Although I must say this feels more like a bug than a feature request. I consider nested .gitignore files to be a core feature of git and therefore support for ignore files should probably also include it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Project Area: project S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants