Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
vendorpull https://github.com/sourcemeta/vendorpull 1dcbac42809cf87cb5b045106b863e17ad84ba02
uwebsockets https://github.com/uNetworking/uWebSockets v20.79.0
core https://github.com/sourcemeta/core 2060a4f64a51bd277c4da802321f20e06089c145
blaze https://github.com/sourcemeta/blaze d3acf3e45a6a4ed9a8b97108b2c32ce9ad1d6da2
jsonbinpack https://github.com/sourcemeta/jsonbinpack 183f333e0e032ebf0a397b5d66ed504c44a0a59f
jsonschema https://github.com/sourcemeta/jsonschema e97e6d539f2124a7e7f1558471359cf95217ce29
core https://github.com/sourcemeta/core 6bbc7a8850da0ad72cd2b2badfc33033a4e48be1
blaze https://github.com/sourcemeta/blaze 49ff4cd2893d52970154a7eea5a729671a9f630a
jsonbinpack https://github.com/sourcemeta/jsonbinpack aa6fb7ae6addfe7d7de1f7f49e8f1bbf9652f5ee
jsonschema https://github.com/sourcemeta/jsonschema v16.2.1
bootstrap https://github.com/twbs/bootstrap v5.3.3
bootstrap-icons https://github.com/twbs/icons v1.11.3
collections/sourcemeta/std/v0 https://github.com/sourcemeta/std v0.4.0
Expand Down
17 changes: 10 additions & 7 deletions enterprise/index/enterprise_index.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,34 @@ auto load_custom_lint_rules(
const sourcemeta::one::BuildDynamicCallback &callback) -> void {
const auto default_dialect{
configuration.default_dialect.value_or(std::string{})};
for (const auto &rule_path : configuration.lint.rules) {
auto rule_schema{sourcemeta::core::read_yaml_or_json(rule_path)};
for (const auto &rule : configuration.lint.rules) {
auto rule_schema{sourcemeta::core::read_yaml_or_json(rule.path)};
try {
custom_names.emplace(bundle.add<sourcemeta::blaze::SchemaRule>(
rule_schema, sourcemeta::blaze::schema_walker,
[&callback, &resolver](
const auto identifier) -> std::optional<sourcemeta::core::JSON> {
return resolver(identifier, callback);
},
sourcemeta::blaze::default_schema_compiler, default_dialect));
sourcemeta::blaze::default_schema_compiler, default_dialect,
std::nullopt,
rule.top_level ? sourcemeta::blaze::SchemaRule::Scope::TopLevel
: sourcemeta::blaze::SchemaRule::Scope::All));
} catch (
const sourcemeta::blaze::SchemaRuleInvalidNamePatternError &error) {
throw sourcemeta::core::FileError<
sourcemeta::blaze::SchemaRuleInvalidNamePatternError>(
rule_path, error.identifier(), error.regex());
rule.path, error.identifier(), error.regex());
} catch (const sourcemeta::blaze::SchemaRuleInvalidNameError &error) {
throw sourcemeta::core::FileError<
sourcemeta::blaze::SchemaRuleInvalidNameError>(
rule_path, error.identifier(), error.what());
rule.path, error.identifier(), error.what());
} catch (const sourcemeta::blaze::SchemaRuleMissingNameError &) {
throw sourcemeta::core::FileError<
sourcemeta::blaze::SchemaRuleMissingNameError>(rule_path);
sourcemeta::blaze::SchemaRuleMissingNameError>(rule.path);
} catch (const sourcemeta::blaze::SchemaUnknownBaseDialectError &) {
throw sourcemeta::core::FileError<
sourcemeta::blaze::SchemaUnknownBaseDialectError>(rule_path);
sourcemeta::blaze::SchemaUnknownBaseDialectError>(rule.path);
}
}
}
Expand Down
14 changes: 13 additions & 1 deletion enterprise/scripts/sbom-vendorpull.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,19 @@ const IGNORED = new Set([
"jsonschema-draft1",
"jsonschema-draft0",
"openapi",
"spdx"
"spdx",
"iana-oauth/parameters.csv",
"iana-oauth/extensions-error.csv",
"iana-oauth/token-types.csv",
"iana-oauth/token-type-hint.csv",
"iana-oauth/token-endpoint-auth-method.csv",
"iana-oauth/pkce-code-challenge-method.csv",
"iana-oauth/authorization-server-metadata.csv",
"iana-oauth/protected-resource-metadata.csv",
"iana-oauth/client-metadata.csv",
"iana-oauth/uri.csv",
"iana-oauth/token-introspection-response.csv",
"iana-oauth/endpoint.csv"
]);

const IGNORED_PREFIXES = [
Expand Down
16 changes: 12 additions & 4 deletions test/unit/configuration/configuration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,17 @@ TEST(valid_005) {
EXPECT_COLLECTION(configuration, "example", resolve.size(), 0);
EXPECT_COLLECTION(configuration, "example", lint.rules.size(), 2);
EXPECT_COLLECTION(
configuration, "example", lint.rules.at(0),
configuration, "example", lint.rules.at(0).path,
std::filesystem::weakly_canonical(std::filesystem::path{STUB_DIRECTORY} /
"rules" / "my_rule.py"));
EXPECT_COLLECTION(configuration, "example", lint.rules.at(0).top_level,
false);
EXPECT_COLLECTION(
configuration, "example", lint.rules.at(1),
configuration, "example", lint.rules.at(1).path,
std::filesystem::weakly_canonical(std::filesystem::path{STUB_DIRECTORY} /
"rules" / "another_rule.py"));
EXPECT_COLLECTION(configuration, "example", lint.rules.at(1).top_level,
false);
EXPECT_COLLECTION(configuration, "example", ignore.size(), 0);
EXPECT_COLLECTION(configuration, "example", extra.size(), 1);
EXPECT_COLLECTION(configuration, "example",
Expand Down Expand Up @@ -388,9 +392,11 @@ TEST(valid_007) {
EXPECT_COLLECTION(configuration, "example", resolve.size(), 0);
EXPECT_COLLECTION(configuration, "example", lint.rules.size(), 1);
EXPECT_COLLECTION(
configuration, "example", lint.rules.at(0),
configuration, "example", lint.rules.at(0).path,
std::filesystem::weakly_canonical(std::filesystem::path{STUB_DIRECTORY} /
"rules" / "my_rule.py"));
EXPECT_COLLECTION(configuration, "example", lint.rules.at(0).top_level,
false);
EXPECT_COLLECTION(configuration, "example", ignore.size(), 1);
EXPECT_COLLECTION(configuration, "example", ignore.at(0),
std::filesystem::weakly_canonical(
Expand Down Expand Up @@ -438,9 +444,11 @@ TEST(valid_008) {
"https://example.com/schemas");
EXPECT_COLLECTION(configuration, "example", lint.rules.size(), 1);
EXPECT_COLLECTION(
configuration, "example", lint.rules.at(0),
configuration, "example", lint.rules.at(0).path,
std::filesystem::weakly_canonical(std::filesystem::path{STUB_DIRECTORY} /
"folder" / "rules" / "my_rule.py"));
EXPECT_COLLECTION(configuration, "example", lint.rules.at(0).top_level,
false);
EXPECT_COLLECTION(configuration, "example", ignore.size(), 0);

EXPECT_PRIORITY(configuration, "self/v1/schemas", 0);
Expand Down
2 changes: 1 addition & 1 deletion vendor/blaze/DEPENDENCIES

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 24 additions & 7 deletions vendor/blaze/ports/javascript/describe.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading