Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Disable php-cs-fixer "phpdoc_annotation_without_dot" rule #316

Merged
merged 1 commit into from
Nov 1, 2017
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
5 changes: 3 additions & 2 deletions artman/tasks/format_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ class PhpFormatTask(task_base.TaskBase):
def execute(self, gapic_code_dir):
abs_code_dir = os.path.abspath(gapic_code_dir)
logger.info('Formatting file using php-cs-fixer in %s.' % abs_code_dir)
subprocess.call(
['php-cs-fixer', 'fix', '--rules=@Symfony', gapic_code_dir])
subprocess.call(['php-cs-fixer', 'fix',
'--rules=@Symfony,-phpdoc_annotation_without_dot',
gapic_code_dir])
# We require a second call to php-cs-fixer because instances of @type
# have been converted to @var. We cannot disable this conversion in
# the first call without affecting other aspects of the formatting.
Expand Down
3 changes: 2 additions & 1 deletion test/tasks/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def test_execute(self, call):
task = format_tasks.PhpFormatTask()
task.execute('/path/to/gapic')
expected_cmds = (
'php-cs-fixer fix --rules=@Symfony /path/to/gapic',
'php-cs-fixer fix --rules=@Symfony,-phpdoc_annotation_without_dot '
'/path/to/gapic',
'php-cs-fixer fix --rules={"phpdoc_no_alias_tag" : {'
'"replacements" : {"var" : "type"}}} /path/to/gapic',
'phpcbf --standard=PSR2 --no-patch /path/to/gapic',
Expand Down