Skip to content

feat(sync): add .gitattributes export-ignore management to dev-tools:sync (#13)#27

Merged
coisa merged 7 commits intomainfrom
feature/13-gitattributes-sync
Apr 11, 2026
Merged

feat(sync): add .gitattributes export-ignore management to dev-tools:sync (#13)#27
coisa merged 7 commits intomainfrom
feature/13-gitattributes-sync

Conversation

@coisa
Copy link
Copy Markdown
Contributor

@coisa coisa commented Apr 10, 2026

Summary

  • Implements .gitattributes export-ignore management as a standalone gitattributes command
  • Adds new GitAttributes namespace with isolated, single-responsibility classes
  • Integrates into dev-tools:sync for automatic execution

New Classes

Class Responsibility
GitAttributesCommand Standalone command for managing export-ignore
ReaderInterface / Reader Reads existing .gitattributes entries
WriterInterface / Writer Writes normalized .gitattributes content
MergerInterface / Merger Merges export-ignore entries with custom rules
ExportIgnoreFilterInterface / ExportIgnoreFilter Filters paths to ignore during export
CandidateProviderInterface / CandidateProvider Provides canonical list of candidate paths
ExistenceCheckerInterface / ExistenceChecker Checks which paths exist in the repo

Behavior

The gitattributes command:

  1. Reads existing .gitattributes entries via Reader
  2. Gets canonical candidate paths from CandidateProvider
  3. Filters to existing paths using ExistenceChecker
  4. Merges entries while preserving custom rules via Merger
  5. Writes normalized content via Writer (folders first, then files, alphabetical)

The sync command now calls gitattributes automatically.

Testing

  • All 178 tests pass
  • New test classes for all GitAttributes classes
  • SyncCommandTest updated for integration

Closes #13

Changelog

Added

  • .gitattributes export-ignore management via dev-tools:sync command

- Extract GitAttributesCommand from SyncCommand for standalone execution
- SyncCommand now calls gitattributes via runCommand like gitignore
- Register GitAttributesCommand in DevToolsCommandProvider
- Update tests to include new command and dependencies
@coisa coisa force-pushed the feature/13-gitattributes-sync branch from 82ea6cd to 500f85b Compare April 10, 2026 14:18
coisa added 4 commits April 10, 2026 11:19
… rules

Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
…ter implementations

- Added Reader and ReaderInterface for reading .gitattributes files.
- Implemented Merger and MergerInterface to handle merging export-ignore entries.
- Created Writer and WriterInterface for writing normalized .gitattributes content.
- Added ExportIgnoreFilter to manage paths to be ignored during export.
- Developed tests for Reader, Merger, Writer, and ExportIgnoreFilter functionalities.
- Updated GitAttributesCommand to utilize new Reader, Merger, and Writer classes.
- Enhanced existing tests to cover new functionality and ensure proper behavior.

Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
- Add full list of folders/files from issue #13 to CandidateProvider
- Add gitattributes command documentation to specialized-commands.rst
- Update README.md with gitattributes command and table entry
- Update SyncCommand docs to mention gitattributes call
@coisa coisa self-assigned this Apr 11, 2026
coisa added 2 commits April 10, 2026 23:20
…mponents

Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
@coisa coisa merged commit 7ae43b3 into main Apr 11, 2026
5 checks passed
@coisa coisa deleted the feature/13-gitattributes-sync branch April 11, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance dev-tools:sync to manage .gitattributes export-ignore entries for leaner Composer package archives

1 participant