Skip to content

Commit 94b570d

Browse files
authored
Show skipped views in the output of build command (#531)
1 parent f9a4bbc commit 94b570d

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/Commands/BuildCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private function outputStyle($action)
9696
{
9797
if ($action === 'deleted') {
9898
return 'error';
99-
} elseif ($action === 'updated') {
99+
} elseif ($action === 'updated' || $action === 'skipped') {
100100
return 'comment';
101101
}
102102

src/Generators/Statements/ViewGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function output(Tree $tree): array
3838
$path = $this->getPath($statement->view());
3939

4040
if ($this->filesystem->exists($path)) {
41-
// TODO: mark skipped...
41+
$output['skipped'][] = $path;
4242
continue;
4343
}
4444

tests/Feature/Generators/Statements/ViewGeneratorTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function output_writes_views_for_render_statements()
107107
/**
108108
* @test
109109
*/
110-
public function it_only_outputs_new_views()
110+
public function it_outputs_skipped_views()
111111
{
112112
$this->filesystem->expects('stub')
113113
->with('view.stub')
@@ -126,6 +126,12 @@ public function it_only_outputs_new_views()
126126
$tokens = $this->blueprint->parse($this->fixture('drafts/render-statements.yaml'));
127127
$tree = $this->blueprint->analyze($tokens);
128128

129-
$this->assertEquals([], $this->subject->output($tree));
129+
$this->assertEquals([
130+
"skipped" => [
131+
"resources/views/user/index.blade.php",
132+
"resources/views/user/create.blade.php",
133+
"resources/views/post/show.blade.php",
134+
],
135+
], $this->subject->output($tree));
130136
}
131137
}

0 commit comments

Comments
 (0)