mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-14 02:42:40 +01:00
4d512c51d4
Summary: Separate XHPAST linter rules in isolation from other rules and formalize the concept of a "linter rule". As the number of XHPAST linter rules grows (we currently have around 80), it becomes increasingly difficult to manage all of the test cases because `ArcanistXHPASTLinterTestCase` currently tests the entire linter (i.e. //all// linter rules) rather than testing individual rules in isolation. See D13534 for a situation in which this is painful. This is particularly bad for third party development because unit tests could break at any time depending on upstream changes. Basically, in order to facilitate the unit testing of XHPAST linter rules in isolation, I have made the following changes: # Added a `setRules()` method to `ArcanistXHPASTLinter`. Currently, `ArcanistXHPASTLinter` loads all `ArcanistXHPASTLinterRule` subclasses unconditionally. The `setRules()` method provides a way to override the configured linter rules. # Formalize the concept of a "linter rule". The `ArcanistXHPASTLinterRule` class was introduced in D10541. I feel that the modularization of `ArcanistXHPASTLinter` has made the linter much more maintainable and easily testable and I intend to extend this concept to other linters, such as `ArcanistTextLinter`. Test Plan: Ran unit tests. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D14010
53 lines
1.1 KiB
INI
53 lines
1.1 KiB
INI
; http://editorconfig.org/
|
|
|
|
[*]
|
|
indent_style = space
|
|
indent_size = 2
|
|
end_of_line = lf
|
|
charset = utf-8
|
|
trim_trailing_whitespace = true
|
|
insert_final_newline = true
|
|
max_line_length = 80
|
|
|
|
[src/lint/linter/**/__tests__/**.lint-test]
|
|
indent_style =
|
|
end_of_line =
|
|
max_line_length =
|
|
trim_trailing_whitespace = false
|
|
|
|
[src/parser/__tests__/bundle/*]
|
|
insert_final_newline = false
|
|
|
|
[src/parser/__tests__/diff/*.{git,hg,rcs,svn,u}diff]
|
|
indent_style =
|
|
trim_trailing_whitespace = false
|
|
insert_final_newline = false
|
|
max_line_length =
|
|
|
|
[src/parser/__tests__/patches/*.{git,hg,rcs,svn,u}patch]
|
|
indent_style =
|
|
trim_trailing_whitespace = false
|
|
max_line_length =
|
|
|
|
[src/parser/__tests__/patches/*.gitpatch]
|
|
end_of_line =
|
|
|
|
[src/parser/__tests__/**/*.txt]
|
|
max_line_length =
|
|
|
|
[src/repository/parser/__tests__/mercurial/*.txt]
|
|
trim_trailing_whitespace = false
|
|
insert_final_newline = false
|
|
max_line_length =
|
|
|
|
[src/unit/parser/__tests__/testresults/go.*]
|
|
indent_style =
|
|
|
|
[src/unit/parser/__tests__/testresults/xunit.*]
|
|
max_line_length =
|
|
|
|
[externals/**]
|
|
indent_style =
|
|
indent_size =
|
|
trim_trailing_whitespace = false
|
|
insert_final_newline = false
|