Skip to content

Commit b622d38

Browse files
committed
feat(gitignore): add docs for command to merge and synchronize .gitignore files
Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
1 parent 8508d92 commit b622d38

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ composer dev-tools wiki
5858
# Generate documentation frontpage and related reports
5959
composer dev-tools reports
6060

61+
# Merges and synchronizes .gitignore files
62+
composer dev-tools gitignore
63+
6164
# Installs and synchronizes dev-tools scripts, GitHub Actions workflows, .editorconfig, and ensures the repository wiki is present as a git submodule in .github/wiki
6265
composer dev-tools:sync
6366
```

docs/api/commands.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ resolution, configuration fallback, PSR-4 lookup, and child-command dispatch.
4242
* - ``FastForward\DevTools\Command\SyncCommand``
4343
- ``dev-tools:sync``
4444
- Synchronizes consumer-facing scripts and automation assets.
45+
* - ``FastForward\DevTools\Command\GitIgnoreCommand``
46+
- ``gitignore``
47+
- Merges and synchronizes .gitignore files.

docs/running/specialized-commands.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,24 @@ Important details:
138138
- it copies missing workflow stubs, ``.editorconfig``, and ``dependabot.yml``;
139139
- it creates ``.github/wiki`` as a git submodule when the directory is
140140
missing.
141+
- it calls ``gitignore`` to merge the canonical .gitignore with the project's .gitignore.
142+
143+
``gitignore``
144+
-------------
145+
146+
Merges and synchronizes .gitignore files.
147+
148+
.. code-block:: bash
149+
150+
composer dev-tools gitignore
151+
composer dev-tools gitignore -- --source=/path/to/source/.gitignore --target=/path/to/target/.gitignore
152+
153+
Important details:
154+
155+
- it reads the canonical .gitignore from dev-tools and merges with the
156+
project's existing .gitignore;
157+
- by default, the source is the packaged .gitignore and the target is the
158+
project's root .gitignore;
159+
- duplicates are removed and entries are sorted alphabetically;
160+
- it uses the Reader, Merger, and Writer components from the GitIgnore
161+
namespace.

0 commit comments

Comments
 (0)