Skip to content

Commit dc40776

Browse files
committed
fix a lint issue
Signed-off-by: Balakrishna Avulapati <ba@bavulapati.com>
1 parent 852043e commit dc40776

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

src/.clang-tidy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# See https://clang.llvm.org/extra/clang-tidy/index.html
33
Checks: '
44
concurrency-*,
5-
performance-*,
5+
bugprone-*,
6+
-bugprone-easily-swappable-parameters,
67
'
78
InheritParentConfig: true
89
WarningsAsErrors: '*'

src/core/jsonschema/frame.cc

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,9 @@ auto find_anchors(const sourcemeta::core::JSON &schema,
7676
const sourcemeta::core::URI identifier(schema.at("$id").to_string());
7777
if (identifier.is_fragment_only()) {
7878
result.insert(
79-
{sourcemeta::core::JSON::String{
80-
identifier.fragment()
81-
.value()}, // NOLINT(bugprone-unchecked-optional-access):
82-
// Check for optional is happening
83-
// inside is_fragment_only()
79+
// Check for optional is happening inside is_fragment_only()
80+
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
81+
{sourcemeta::core::JSON::String{identifier.fragment().value()},
8482
AnchorType::Static});
8583
}
8684
}
@@ -95,11 +93,9 @@ auto find_anchors(const sourcemeta::core::JSON &schema,
9593
const sourcemeta::core::URI identifier(schema.at("id").to_string());
9694
if (identifier.is_fragment_only()) {
9795
result.insert(
98-
{sourcemeta::core::JSON::String{
99-
identifier.fragment()
100-
.value()}, // NOLINT(bugprone-unchecked-optional-access):
101-
// Check for optional is happening
102-
// inside is_fragment_only()
96+
// Check for optional is happening inside is_fragment_only()
97+
// NOLINTNEXTLINE(bugprone-unchecked-optional-access)
98+
{sourcemeta::core::JSON::String{identifier.fragment().value()},
10399
AnchorType::Static});
104100
}
105101
}

src/core/uri/uri.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,6 @@ auto URI::try_resolve_from(const URI &base) -> URI & {
681681
this->scheme_ = base.scheme_;
682682
this->query_ = base.query_;
683683
return *this;
684-
} else if (base.path().has_value() && base.path().value().starts_with("..")) {
685-
return *this;
686684
} else if (base.is_relative() && this->is_relative() &&
687685
base.path_.has_value() && this->path_.has_value() &&
688686
this->path_.value().find('/') == std::string::npos &&

0 commit comments

Comments
 (0)