From 31dc0b915e613edbd128fd79bc21543dec68e26b Mon Sep 17 00:00:00 2001 From: Jan-Marten de Boer Date: Mon, 23 Jul 2018 15:50:04 +0200 Subject: [PATCH] Exclude specific files from archives By adding files to `archive.exclude` within `composer.json`, the dist package is kept clean when composer is generating an archive. However, Github also creates a dist file, using `.gitattributes`. Hence, the exclude rules are copied over to `.gitattributes`. --- .gitattributes | 12 ++++++++++++ composer.json | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..cd2c09b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,12 @@ +/CODE_OF_CONDUCT.md export-ignore +/CONTRIBUTING.md export-ignore +/.github export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/grumphp.dist.yml export-ignore +/phpunit.xml export-ignore +/phpmd.xml export-ignore +/phpstan.neon export-ignore +/phpcs.xml export-ignore +/bitbucket-pipelines.yml export-ignore +/tests export-ignore diff --git a/composer.json b/composer.json index 27b79f5..8ba5f95 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,12 @@ }, "archive": { "exclude": [ + "/CODE_OF_CONDUCT.md", + "/CONTRIBUTING.md", + "/.github", + "/.gitattributes", "/.gitignore", + "/grumphp.dist.yml", "/phpunit.xml", "/phpmd.xml", "/phpstan.neon",