question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow ignoring files for `status` and `add`

See original GitHub issue

Affected Packages

@changesets/git, @changesets:cli

Problem

We do not publish any of our test files in our packages. So a change that only affects test files never needs a changeset. It would be nice if changeset add didn’t list a package with test-only changes as a changed package, and if changeset status didn’t consider a package with test-only changes as needing a changeset.

Proposed solution

Allow specifying some sort of lists of globs or patterns like **/__tests__/** in config.json for files that should be ignored by getChangedFilesSince. For me it would be fine for this to be a single configuration point in config.json rooted at the top of the repository rather than per-package. (Perhaps this needs to also support ! like .npmignore to unignore things ignored by previous lines.)

Note that the answer is not to apply .npmignore, since you may use .npmignore to avoid publishing source files whose compiled output goes in the package. This needs to specifically be about files where changes to them never affect the package output.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Andaristcommented, Aug 28, 2022

One problem with this is that those ignore files usually live at the root, together with config files. In Changesets, we keep the config in the .changeset directory. I’m not totally sure if .changesetignore would also immediately point to what we are actually ignoring here - a config option can be way more descriptive in this case.

1reaction
with-heartcommented, Aug 28, 2022

What do yall think about implementing this through a plaintext .changesetignore file? Follows a fairly common pattern in js tooling for ignoring files, so it’d be immediately familiar to many users.

Read more comments on GitHub >

github_iconTop Results From Across the Web

git add adding ignored files - Stack Overflow
The git add command will not add ignored files by default. ... The git add command can be used to add ignored files...
Read more >
.gitignore file - ignoring files in Git | Atlassian Git Tutorial
Git ignore patterns are used to exclude certain files in your working directory from your Git history. They can be local, global, or...
Read more >
Ignoring files - GitHub Docs
If you want to ignore a file that is already checked in, you must untrack the file before you add a rule to...
Read more >
.gitignore File – How to Ignore Files and Folders in Git
Git can only ignore untracked files that haven't yet been committed to the repository.
Read more >
How can I ignore a file that has already been committed to a ...
Git can only ignore files that are untracked - files that haven't been committed to the repository, yet. That's why, when you create...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found