Skip to content

Commit

Permalink
Apply clang-format and update copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
IEncinas10 committed Jul 6, 2023
1 parent 34477e0 commit 0f21ce0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions common/analysis/linter_test_utils.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2020 The Verible Authors.
// Copyright 2017-2023 The Verible Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -50,9 +50,9 @@ struct LintTestCase : public TokenInfoTestData {
// Returns true if every element is an exact match to the expected set.
// TODO(b/141875806): Take a symbol translator function to produce a
// human-readable, language-specific enum name.
bool ExactMatchFindings(const std::set<LintViolation>& found_violations,
bool ExactMatchFindings(const std::set<LintViolation> &found_violations,
absl::string_view base,
std::ostream* diffstream) const;
std::ostream *diffstream) const;
};

template <typename RuleType>
Expand All @@ -66,8 +66,8 @@ class LintRunner;
// Tests that LintTestCase test has expected violations under make_rule
// Expects test.code to be accepted by AnalyzerType.
template <class AnalyzerType, class RuleType>
void RunLintTestCase(const LintTestCase& test,
const LintRuleGenerator<RuleType>& make_rule,
void RunLintTestCase(const LintTestCase &test,
const LintRuleGenerator<RuleType> &make_rule,
absl::string_view filename) {
// All linters start by parsing to yield a TextStructure.
// TODO(hzeller): make preprocessor configurable. Right now, preprocessor
Expand All @@ -78,7 +78,7 @@ void RunLintTestCase(const LintTestCase& test,
// Instantiate a linter that runs a single rule to analyze text.
LintRunner<RuleType> lint_runner(make_rule());
const LintRuleStatus rule_status = lint_runner.Run(analyzer.Data(), filename);
const auto& violations(rule_status.violations);
const auto &violations(rule_status.violations);

// Report detailed differences, if any.
const absl::string_view base_text = analyzer.Data().Contents();
Expand All @@ -100,7 +100,7 @@ void RunConfiguredLintTestCases(
CHECK(config_status.ok()) << config_status.message();
return instance;
};
for (const auto& test : tests) {
for (const auto &test : tests) {
RunLintTestCase<AnalyzerType, rule_type>(test, rule_generator, filename);
}
}
Expand All @@ -120,8 +120,8 @@ struct AutoFixInOut {
// Tests that LintTestCase test has expected violations under make_rule
// Expects test.code to be accepted by AnalyzerType.
template <class AnalyzerType, class RuleType>
void RunLintAutoFixCase(const AutoFixInOut& test,
const LintRuleGenerator<RuleType>& make_rule) {
void RunLintAutoFixCase(const AutoFixInOut &test,
const LintRuleGenerator<RuleType> &make_rule) {
// All linters start by parsing to yield a TextStructure.
AnalyzerType analyzer(test.code, "");
absl::Status unused_parser_status = analyzer.Analyze();
Expand Down Expand Up @@ -158,7 +158,7 @@ void RunApplyFixCases(std::initializer_list<AutoFixInOut> tests,
CHECK(config_status.ok()) << config_status.message();
return instance;
};
for (const auto& test : tests) {
for (const auto &test : tests) {
RunLintAutoFixCase<AnalyzerType, rule_type>(test, rule_generator);
}
}
Expand Down

0 comments on commit 0f21ce0

Please sign in to comment.