Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing pre-commit phpcs validation to find docroot differently. #32

Merged
merged 1 commit into from
May 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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