Skip to content

Commit

Permalink
Fix missing glob pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelstolt committed Oct 2, 2017
1 parent 4856245 commit d61aeee
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

## [Unreleased]

## [v1.7.3] - 2017-10-02
### Fixed
- Fix dist file pattern to also match `*.dist` files.

## [v1.7.2] - 2017-05-08
### Fixed
- Fix non existent export ignored artifacts are excluded from validation. Fixes [#22](https://github.com/raphaelstolt/lean-package-validator/issues/22).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The `--glob-pattern` option allows you to overwrite the default pattern\* used t
``` bash
lean-package-validator validate [<directory>] --glob-pattern '{.*,*.rst,*.py[cod],dist/}'
```
\* The default pattern is `{.*,*.lock,*.txt,*.rst,*.{md,MD},*.xml,*.yml,appveyor.yml,box.json,captainhook.json,*.dist.*,{B,b}uild*,{D,d}oc*,{T,t}ool*,{T,t}est*,{S,s}pec*,{E,e}xample*,LICENSE,{{M,m}ake,{B,b}ox,{V,v}agrant,{P,p}hulp}file,RMT}*`.
\* The default pattern is `{.*,*.lock,*.txt,*.rst,*.{md,MD},*.xml,*.yml,appveyor.yml,box.json,captainhook.json,*.dist.*,*.dist,{B,b}uild*,{D,d}oc*,{T,t}ool*,{T,t}est*,{S,s}pec*,{E,e}xample*,LICENSE,{{M,m}ake,{B,b}ox,{V,v}agrant,{P,p}hulp}file,RMT}*`.

The `--glob-pattern-file` option allows you to load patterns, which should be used to match the common repository artifacts, from a given file. You can put a `.lpv` file in the repository which will be used per default and overwrite the default pattern\*. The structure of such a glob pattern file can be taken from the [example](example/.lpv) directory or be created via `lean-package-validator init`.

Expand Down
1 change: 1 addition & 0 deletions src/Analyser.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public function __construct()
'box.json',
'captainhook.json',
'*.dist.*',
'*.dist',
'{B,b}uild*',
'{D,d}oc*',
'{T,t}ool*',
Expand Down
35 changes: 35 additions & 0 deletions tests/AnalyserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,40 @@ public function globPatternWithEnclosedBracesAreConsideredValid()
->setGlobPattern('{{{M,m}ake,{B,b}ox,{V,v}agrant}file,RMT}');
}

/**
* @test
*/
public function withDistEndingFilesAreNotExportIgnored()
{
$artifactFilenames = [
'SUPPORT.md',
'README.md',
'humbug.json.dist',
];

$this->createTemporaryFiles(
$artifactFilenames
);

$expectedGitattributesContent = <<<CONTENT
* text=auto eol=lf
.gitattributes export-ignore
humbug.json.dist export-ignore
README.md export-ignore
SUPPORT.md export-ignore
CONTENT;

$analyser = (new Analyser())->setDirectory($this->temporaryDirectory);
$actualGitattributesContent = $analyser->getExpectedGitattributesContent();

$this->assertEquals(
$expectedGitattributesContent,
$actualGitattributesContent
);
}

/**
* @test
* @ticket 15 (https://github.com/raphaelstolt/lean-package-validator/issues/15)
Expand Down Expand Up @@ -1365,6 +1399,7 @@ public function returnsExpectedDefaultGlobPatterns()
'box.json',
'captainhook.json',
'*.dist.*',
'*.dist',
'{B,b}uild*',
'{D,d}oc*',
'{T,t}ool*',
Expand Down
1 change: 1 addition & 0 deletions tests/Commands/InitCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public function createsExpectedDefaultLpvFile()
box.json
captainhook.json
*.dist.*
*.dist
{B,b}uild*
{D,d}oc*
{T,t}ool*
Expand Down

0 comments on commit d61aeee

Please sign in to comment.