Skip to content

Commit

Permalink
Use json-stringify to format jsons. (#1022)
Browse files Browse the repository at this point in the history
  • Loading branch information
goodov authored Apr 25, 2024
1 parent 1415b9d commit 07fa1ec
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 27 deletions.
4 changes: 3 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["local>brave/renovate-config"]
"extends": [
"local>brave/renovate-config"
]
}
9 changes: 9 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,13 @@
module.exports = {
plugins: ['prettier-plugin-organize-imports'],
singleQuote: true,
overrides: [
{
files: '*.json',
excludeFiles: 'tsconfig.json',
options: {
parser: 'json-stringify',
},
},
],
};
148 changes: 122 additions & 26 deletions src/test/data/seed1.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,37 @@
"name": "StudyKillSwitch",
"experiments": [
{
"feature_association": { "enable_feature": ["SomeFeature"] },
"feature_association": {
"enable_feature": [
"SomeFeature"
]
},
"name": "Enabled",
"probability_weight": 100
}
],
"filter": {
"channel": ["RELEASE"],
"channel": [
"RELEASE"
],
"max_version": "299.0.0.0",
"platform": ["WINDOWS", "MAC", "LINUX", "ANDROID"]
"platform": [
"WINDOWS",
"MAC",
"LINUX",
"ANDROID"
]
}
},
{
"name": "Stable-100",
"experiments": [
{
"feature_association": { "enable_feature": ["SomeFeature"] },
"feature_association": {
"enable_feature": [
"SomeFeature"
]
},
"name": "Enabled",
"probability_weight": 99
},
Expand All @@ -31,15 +46,26 @@
}
],
"filter": {
"channel": ["RELEASE"],
"platform": ["WINDOWS", "MAC", "LINUX", "ANDROID"]
"channel": [
"RELEASE"
],
"platform": [
"WINDOWS",
"MAC",
"LINUX",
"ANDROID"
]
}
},
{
"name": "Stable-50",
"experiments": [
{
"feature_association": { "enable_feature": ["SomeFeature"] },
"feature_association": {
"enable_feature": [
"SomeFeature"
]
},
"name": "Enabled",
"probability_weight": 50
},
Expand All @@ -49,92 +75,162 @@
}
],
"filter": {
"channel": ["RELEASE"],
"platform": ["WINDOWS", "MAC", "LINUX", "ANDROID"]
"channel": [
"RELEASE"
],
"platform": [
"WINDOWS",
"MAC",
"LINUX",
"ANDROID"
]
}
},
{
"name": "Stable-min",
"experiments": [
{
"feature_association": { "enable_feature": ["SomeFeature"] },
"feature_association": {
"enable_feature": [
"SomeFeature"
]
},
"name": "Enabled_1",
"probability_weight": 5
},
{
"name": "Control_1",
"feature_association": { "disabled_feature": ["SomeFeature"] },
"feature_association": {
"disabled_feature": [
"SomeFeature"
]
},
"probability_weight": 45
},
{
"name": "Default",
"feature_association": { "disabled_feature": ["SomeFeature"] },
"feature_association": {
"disabled_feature": [
"SomeFeature"
]
},
"probability_weight": 50
}
],
"filter": {
"channel": ["RELEASE"],
"platform": ["WINDOWS", "MAC", "LINUX", "ANDROID"]
"channel": [
"RELEASE"
],
"platform": [
"WINDOWS",
"MAC",
"LINUX",
"ANDROID"
]
}
},
{
"name": "BetaStudy",
"experiments": [
{
"feature_association": { "enable_feature": ["SomeFeature"] },
"feature_association": {
"enable_feature": [
"SomeFeature"
]
},
"name": "Enabled",
"probability_weight": 100
}
],
"filter": {
"channel": ["BETA"],
"platform": ["WINDOWS", "MAC", "LINUX", "ANDROID"]
"channel": [
"BETA"
],
"platform": [
"WINDOWS",
"MAC",
"LINUX",
"ANDROID"
]
}
},
{
"name": "EndedMaxVersion",
"experiments": [
{
"feature_association": { "enable_feature": ["SomeFeature"] },
"feature_association": {
"enable_feature": [
"SomeFeature"
]
},
"name": "Enabled",
"probability_weight": 100
}
],
"filter": {
"channel": ["RELEASE"],
"channel": [
"RELEASE"
],
"max_version": "99.1.49.83",
"platform": ["WINDOWS", "MAC", "LINUX", "ANDROID"]
"platform": [
"WINDOWS",
"MAC",
"LINUX",
"ANDROID"
]
}
},
{
"name": "EndedByDate",
"experiments": [
{
"feature_association": { "enable_feature": ["SomeFeature"] },
"feature_association": {
"enable_feature": [
"SomeFeature"
]
},
"name": "Enabled",
"probability_weight": 100
}
],
"filter": {
"channel": ["RELEASE"],
"channel": [
"RELEASE"
],
"end_date": 1663175424,
"COMMENT": "end_date == Wednesday, September 14, 2022 5:10:24 PM",
"platform": ["WINDOWS", "MAC", "LINUX", "ANDROID"]
"platform": [
"WINDOWS",
"MAC",
"LINUX",
"ANDROID"
]
}
},
{
"name": "BlocklistedStudy",
"experiments": [
{
"feature_association": { "enable_feature": ["Ukm"] },
"feature_association": {
"enable_feature": [
"Ukm"
]
},
"COMMENT": "Ukm is blocklisted feature, see config.js",
"name": "Enabled",
"probability_weight": 100
}
],
"filter": {
"channel": ["RELEASE"],
"platform": ["WINDOWS", "MAC", "LINUX", "ANDROID"]
"channel": [
"RELEASE"
],
"platform": [
"WINDOWS",
"MAC",
"LINUX",
"ANDROID"
]
}
}
],
Expand Down

0 comments on commit 07fa1ec

Please sign in to comment.