Skip to content

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

Open
coisa wants to merge 5 commits intomainfrom
feature/13-gitattributes-sync
Open

feat(sync): add .gitattributes export-ignore management to dev-tools:sync (#13)#27
coisa wants to merge 5 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 part of dev-tools:sync
  • Adds new GitAttributes namespace with separate concerns for maintainability
  • CandidateProvider provides canonical list of files/folders for export-ignore
  • ExistenceChecker determines which candidate paths exist in the repository
  • Merger handles merging/export-ignore entries while preserving custom rules
  • Entries are ordered: folders first, then files, alphabetically sorted within each group

New Classes

Class Responsibility
CandidateProviderInterface / CandidateProvider Provides canonical list of candidate paths
ExistenceCheckerInterface / ExistenceChecker Checks which paths exist in the target repo
MergerInterface / Merger Merges export-ignore entries with existing .gitattributes

Testing

  • All 178 tests pass
  • SyncCommandTest updated with new UseClass attributes for coverage
  • Test verifies command description and help text are updated

Behavior

The sync command now:

  1. Gets canonical candidate paths from CandidateProvider
  2. Filters to only existing paths using ExistenceChecker
  3. Sorts entries (folders first, then files, alphabetical)
  4. Merges into .gitattributes with managed block markers
  5. Preserves custom entries outside the managed block

Closes #13

- 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
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