Skip to content

Commit

Permalink
Changing pre-commit phpcs validation to find docroot differently. (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
grasmash committed May 5, 2016
1 parent e93ef2f commit 8d71d75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ public function setFileList($fileList)
$this->fileList = $fileList;
}

public function setRoot($root)
{
$this->root = $root;
}

/**
* Nested adder, adds a set of files (nested fileset attribute).
*
Expand Down Expand Up @@ -68,10 +63,6 @@ public function main() {
throw new BuildException("You must set the file property.");
}

if (!isset($this->root)) {
throw new BuildException("You must set the project root.");
}

if (count($this->filesets) == 0) {
throw new BuildException("You must define a fileset.");
}
Expand All @@ -90,7 +81,7 @@ public function main() {
}

protected function prependProjectPath($relative_path) {
return $this->root. DIRECTORY_SEPARATOR . $relative_path;
return $this->project->getBasedir()->getAbsolutePath() . DIRECTORY_SEPARATOR . $relative_path;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion template/build/core/phing/tasks/validate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<fail unless="files" message="Missing files parameter."/>
<property name="phpcs.ruleset" value="${repo.root}/vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml"/>

<filterFileListByFileSet fileList="${files}" returnProperty="filteredFileList" root="${repo.root}">
<filterFileListByFileSet fileList="${files}" returnProperty="filteredFileList">
<fileset refid="files.php.custom.modules"/>
<fileset refid="files.php.custom.themes"/>
<fileset refid="files.php.tests"/>
Expand Down

0 comments on commit 8d71d75

Please sign in to comment.