当前位置: 首页>>代码示例>>Python>>正文


Python Phpcs.create_command方法代码示例

本文整理汇总了Python中lintreview.tools.phpcs.Phpcs.create_command方法的典型用法代码示例。如果您正苦于以下问题:Python Phpcs.create_command方法的具体用法?Python Phpcs.create_command怎么用?Python Phpcs.create_command使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lintreview.tools.phpcs.Phpcs的用法示例。


在下文中一共展示了Phpcs.create_command方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_create_command__with_path_based_standard

# 需要导入模块: from lintreview.tools.phpcs import Phpcs [as 别名]
# 或者: from lintreview.tools.phpcs.Phpcs import create_command [as 别名]
 def test_create_command__with_path_based_standard(self):
     config = {"standard": "test/CodeStandards"}
     tool = Phpcs(self.problems, config, "/some/path")
     result = tool.create_command(["some/file.php"])
     expected = [
         "phpcs",
         "--report=checkstyle",
         "--standard=/some/path/test/CodeStandards",
         "--extensions=php",
         "some/file.php",
     ]
     eq_(result, expected)
开发者ID:kevinjqiu,项目名称:lint-review,代码行数:14,代码来源:test_phpcs.py

示例2: test_create_command__with_path_based_standard

# 需要导入模块: from lintreview.tools.phpcs import Phpcs [as 别名]
# 或者: from lintreview.tools.phpcs.Phpcs import create_command [as 别名]
 def test_create_command__with_path_based_standard(self):
     config = {
         'standard': 'test/CodeStandards'
     }
     tool = Phpcs(self.problems, config, '/some/path')
     result = tool.create_command(['some/file.php'])
     expected = [
         'phpcs',
         '--report=checkstyle',
         '--standard=/some/path/test/CodeStandards',
         '--extensions=php',
         'some/file.php'
     ]
     eq_(result, expected)
开发者ID:alexBaizeau,项目名称:lint-review,代码行数:16,代码来源:test_phpcs.py

示例3: test_create_command__with_path_based_standard

# 需要导入模块: from lintreview.tools.phpcs import Phpcs [as 别名]
# 或者: from lintreview.tools.phpcs.Phpcs import create_command [as 别名]
 def test_create_command__with_path_based_standard(self):
     config = {
         'standard': 'test/CodeStandards',
         'tab_width': 4,
     }
     tool = Phpcs(self.problems, config, root_dir)
     result = tool.create_command(['some/file.php'])
     expected = [
         'phpcs',
         '--report=checkstyle',
         '--standard=/src/test/CodeStandards',
         '--extensions=php',
         '--tab-width=4',
         '/src/some/file.php'
     ]
     self.assertEqual(result, expected)
开发者ID:markstory,项目名称:lint-review,代码行数:18,代码来源:test_phpcs.py

示例4: test_create_command__with_path_based_standard

# 需要导入模块: from lintreview.tools.phpcs import Phpcs [as 别名]
# 或者: from lintreview.tools.phpcs.Phpcs import create_command [as 别名]
 def test_create_command__with_path_based_standard(self):
     command = 'vendor/bin/phpcs'
     if phpcs_missing:
         command = 'phpcs'
     config = {
         'standard': 'test/CodeStandards',
         'tab_width': 4,
     }
     tool = Phpcs(self.problems, config, '/some/path')
     result = tool.create_command(['some/file.php'])
     expected = [
         command,
         '--report=checkstyle',
         '--standard=/some/path/test/CodeStandards',
         '--extensions=php',
         '--tab-width=4',
         'some/file.php'
     ]
     eq_(result, expected)
开发者ID:halfcrazy,项目名称:lint-review,代码行数:21,代码来源:test_phpcs.py

示例5: test_create_command__ignore_option_as_list

# 需要导入模块: from lintreview.tools.phpcs import Phpcs [as 别名]
# 或者: from lintreview.tools.phpcs.Phpcs import create_command [as 别名]
 def test_create_command__ignore_option_as_list(self):
     config = {
         'standard': 'PSR2',
         'extensions': ['php', 'ctp'],
         'exclude': ['rule1', 'rule2'],
         'ignore': ['tests/fixtures/phpcs/*', 'tests/fixtures/eslint/*']
     }
     tool = Phpcs(self.problems, config, root_dir)
     result = tool.create_command(['some/file.php'])
     expected = [
         'phpcs',
         '--report=checkstyle',
         '--standard=PSR2',
         '--ignore=tests/fixtures/phpcs/*,tests/fixtures/eslint/*',
         '--exclude=rule1,rule2',
         '--extensions=php,ctp',
         '/src/some/file.php'
     ]
     self.assertEqual(result, expected)
开发者ID:markstory,项目名称:lint-review,代码行数:21,代码来源:test_phpcs.py

示例6: test_create_command__ignore_option_as_list

# 需要导入模块: from lintreview.tools.phpcs import Phpcs [as 别名]
# 或者: from lintreview.tools.phpcs.Phpcs import create_command [as 别名]
 def test_create_command__ignore_option_as_list(self):
     config = {
         'standard': 'PSR2',
         'extensions': ['php', 'ctp'],
         'exclude': ['rule1', 'rule2'],
         'ignore': ['tests/fixtures/phpcs/*', 'tests/fixtures/eslint/*']
     }
     tool = Phpcs(self.problems, config)
     result = tool.create_command(['some/file.php'])
     command = 'vendor/bin/phpcs'
     if phpcs_missing:
         command = 'phpcs'
     expected = [
         command,
         '--report=checkstyle',
         '--standard=PSR2',
         '--ignore=tests/fixtures/phpcs/*,tests/fixtures/eslint/*',
         '--exclude=rule1,rule2',
         '--extensions=php,ctp',
         'some/file.php'
     ]
     eq_(result, expected)
开发者ID:esoergel,项目名称:lint-review,代码行数:24,代码来源:test_phpcs.py


注:本文中的lintreview.tools.phpcs.Phpcs.create_command方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。