mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Auto merge of #14896 - g1smo:tidy-assignments, r=jdm
Tidy assignments <!-- Please describe your changes on the following line: --> I've added a new tidy rule (no = in the beginning of line) + tests for it. Also cleaned up a few rust source files to accord with the new rule. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #14890 (github issue number if applicable). <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14896) <!-- Reviewable:end -->
This commit is contained in:
commit
b6c137b36f
6 changed files with 12 additions and 6 deletions
|
@ -1283,8 +1283,8 @@ impl BlockFlow {
|
||||||
content_block_size,
|
content_block_size,
|
||||||
available_block_size));
|
available_block_size));
|
||||||
|
|
||||||
candidate_block_size_iterator.candidate_value
|
candidate_block_size_iterator.candidate_value =
|
||||||
= solution.unwrap().block_size;
|
solution.unwrap().block_size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1290,8 +1290,8 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
|
||||||
for kid in node.children() {
|
for kid in node.children() {
|
||||||
// CSS 2.1 § 17.2.1. Treat all non-column child fragments of `table-column-group`
|
// CSS 2.1 § 17.2.1. Treat all non-column child fragments of `table-column-group`
|
||||||
// as `display: none`.
|
// as `display: none`.
|
||||||
if let ConstructionResult::ConstructionItem(ConstructionItem::TableColumnFragment(fragment))
|
if let ConstructionResult::ConstructionItem(ConstructionItem::TableColumnFragment(fragment)) =
|
||||||
= kid.swap_out_construction_result() {
|
kid.swap_out_construction_result() {
|
||||||
col_fragments.push(fragment)
|
col_fragments.push(fragment)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,8 +51,8 @@ macro_rules! thread_types ( ( $( $fun:ident = $flag:ident ; )* ) => (
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
static TYPES: &'static [ThreadState]
|
static TYPES: &'static [ThreadState] =
|
||||||
= &[ $( $flag ),* ];
|
&[ $( $flag ),* ];
|
||||||
));
|
));
|
||||||
|
|
||||||
thread_types! {
|
thread_types! {
|
||||||
|
|
|
@ -520,6 +520,8 @@ def check_rust(file_name, lines):
|
||||||
lambda match, line: is_attribute),
|
lambda match, line: is_attribute),
|
||||||
(r"=[A-Za-z0-9\"]", "missing space after =",
|
(r"=[A-Za-z0-9\"]", "missing space after =",
|
||||||
lambda match, line: is_attribute),
|
lambda match, line: is_attribute),
|
||||||
|
(r"^=\s", "no = in the beginning of line",
|
||||||
|
lambda match, line: not is_comment),
|
||||||
# ignore scientific notation patterns like 1e-6
|
# ignore scientific notation patterns like 1e-6
|
||||||
(r"[A-DF-Za-df-z0-9]-", "missing space before -",
|
(r"[A-DF-Za-df-z0-9]-", "missing space before -",
|
||||||
lambda match, line: not is_attribute),
|
lambda match, line: not is_attribute),
|
||||||
|
|
|
@ -59,4 +59,7 @@ impl test {
|
||||||
|
|
||||||
// Should not be triggered
|
// Should not be triggered
|
||||||
macro_rules! test_macro ( ( $( $fun:ident = $flag:ident ; )* ) => ());
|
macro_rules! test_macro ( ( $( $fun:ident = $flag:ident ; )* ) => ());
|
||||||
|
|
||||||
|
let var
|
||||||
|
= "val";
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,6 +125,7 @@ class CheckTidiness(unittest.TestCase):
|
||||||
self.assertEqual('extra space after (', errors.next()[2])
|
self.assertEqual('extra space after (', errors.next()[2])
|
||||||
self.assertEqual('extra space after (', errors.next()[2])
|
self.assertEqual('extra space after (', errors.next()[2])
|
||||||
self.assertEqual('extra space after test_fun', errors.next()[2])
|
self.assertEqual('extra space after test_fun', errors.next()[2])
|
||||||
|
self.assertEqual('no = in the beginning of line', errors.next()[2])
|
||||||
self.assertNoMoreErrors(errors)
|
self.assertNoMoreErrors(errors)
|
||||||
|
|
||||||
feature_errors = tidy.collect_errors_for_files(iterFile('lib.rs'), [], [tidy.check_rust], print_text=False)
|
feature_errors = tidy.collect_errors_for_files(iterFile('lib.rs'), [], [tidy.check_rust], print_text=False)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue