diplodoc-platform / diplodoc-platform/cli

Support .yfmignore to exclude files from processing

Open
#1,398 0 comments 0 reactions 0 assignees View on GitHub
good first issue
Dominant language
TypeScript
Stars
123
Forks
51
Avg merge
10h 50m
Merged PRs (30d)
38

Description

## Description

Add support for a `.yfmignore` file in the project root to specify files and directories that should be skipped by the CLI. The file should accept relative paths and glob patterns.

---

## Use Case

- Exclude drafts, temporary files, large asset folders, or generated content from **parse/validate/build** steps.
- Speed up builds and reduce noise.

---

## Expected Behavior

- If `.yfmignore` exists, the CLI **excludes matching files** from all processing stages (parse, validate, build, search index, etc.).
- Patterns are **resolved relative to the project root**.

---

## Supported Syntax

- **Glob patterns**: `*`, `**`, `?`, `[abc]`
- **Directory patterns**: directory with trailing slash
- **Negation**: `!` to re-include files/folders
- **Comments**: lines starting with `#`
- **Blank lines**: are ignored
- **Cross-platform**: works consistently on all operating systems

---

## Example `.yfmignore`

```
# ignore drafts and tmp
drafts/**
tmp/**

# ignore images but keep logos
assets/images/**
!assets/images/logos/**
```

---

## Acceptance Criteria

- The CLI reads and applies `.yfmignore` when present.
- Files matching ignore patterns **are not processed or reported as missing**.
- **Negation patterns** work as expected.
- No change in behavior when `.yfmignore` is absent.
- **Clear documentation** is added, including examples.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.