Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupalci_testbot-3254634
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupalci_testbot-3254634
Commits
ecb58bb0
Commit
ecb58bb0
authored
Jan 12, 2022
by
James Gilliland
Committed by
Tim Hestenes Lehnen
Oct 6, 2022
Browse files
Options
Downloads
Patches
Plain Diff
Support custom phpstan rules
Allow core and contrib to run phpstan how ever it likes.
parent
a4319d15
No related branches found
Tags
previous/drupalci_testbot-3254634/2022-10-06-1
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/DrupalCI/Plugin/BuildTask/BuildStep/CodebaseValidate/Phpstan.php
+7
-3
7 additions, 3 deletions
...I/Plugin/BuildTask/BuildStep/CodebaseValidate/Phpstan.php
with
7 additions
and
3 deletions
src/DrupalCI/Plugin/BuildTask/BuildStep/CodebaseValidate/Phpstan.php
+
7
−
3
View file @
ecb58bb0
...
...
@@ -83,16 +83,20 @@ class Phpstan extends BuildTaskBase implements BuildStepInterface, BuildTaskInte
return
0
;
}
$this
->
addPhpstanNeon
();
// Run phpstan.
$source_dir
=
$this
->
environment
->
getExecContainerSourceDir
();
$project_dir
=
$this
->
codebase
->
getProjectConfigDirectory
(
FALSE
);
$work_dir
=
$this
->
environment
->
getContainerWorkDir
();
$this
->
io
->
writeln
(
'<info>Running PHPStan at '
.
$source_dir
);
// If phpstan file is missing, provide some basic deprecation checks.
if
(
!
file_exists
(
$work_dir
.
'/phpstan.neon'
)
||
!
file_exists
(
$work_dir
.
'/phpstan.neon.dist'
))
{
$this
->
addPhpstanNeon
();
$neon
=
'-c '
.
$work_dir
.
'/'
.
$this
->
pluginDir
.
'/phpstan.neon'
;
}
$result
=
$this
->
execEnvironmentCommands
([
'cd '
.
$project_dir
.
' && sudo -u www-data '
.
$source_dir
.
static
::
$phpstanExecutable
.
' analyse --error-format checkstyle
-c
'
.
$
work_dir
.
'/'
.
$this
->
pluginDir
.
'/phpstan.
neon . > '
.
$work_dir
.
'/'
.
$this
->
pluginDir
.
'/phpstan_results.xml'
,
'cd '
.
$project_dir
.
' && sudo -u www-data '
.
$source_dir
.
static
::
$phpstanExecutable
.
' analyse --error-format checkstyle '
.
$neon
.
'
> '
.
$work_dir
.
'/'
.
$this
->
pluginDir
.
'/phpstan_results.xml'
,
]);
// Save phpstan results for later examination.
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment