當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。