VSCode fix (#222)
This commit is contained in:
@@ -58,16 +58,20 @@ def check_json_settings(actual: str, expected: str, **options) -> float:
|
|||||||
if not actual:
|
if not actual:
|
||||||
return 0.
|
return 0.
|
||||||
|
|
||||||
with open(actual, 'r') as f:
|
try:
|
||||||
data = json.load(f)
|
with open(actual, 'r') as f:
|
||||||
|
data = json.load(f)
|
||||||
|
except Exception as e:
|
||||||
|
return 0.0
|
||||||
|
|
||||||
expect = expected['expected']
|
expect = expected['expected']
|
||||||
data_copy = copy.deepcopy(data)
|
|
||||||
data_copy.update(expect)
|
# Check if all expected key-value pairs are in the actual data
|
||||||
if data == data_copy:
|
for key, value in expect.items():
|
||||||
return 1.0
|
if key not in data or data[key] != value:
|
||||||
else:
|
return 0.0
|
||||||
return 0.0
|
|
||||||
|
return 1.0
|
||||||
|
|
||||||
|
|
||||||
def compare_text_file(actual: str, expected: str, **options) -> float:
|
def compare_text_file(actual: str, expected: str, **options) -> float:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "276cc624-87ea-4f08-ab93-f770e3790175",
|
"id": "276cc624-87ea-4f08-ab93-f770e3790175",
|
||||||
"snapshot": "vscode",
|
"snapshot": "vscode",
|
||||||
"instruction": "Please help me set the current user's line length to 50 characters in VS Code.",
|
"instruction": "Please help me set the current user's line length for code wrapping to 50 characters in VS Code.",
|
||||||
"source": "https://www.quora.com/unanswered/How-do-you-set-the-line-length-in-Visual-Studio-Code",
|
"source": "https://www.quora.com/unanswered/How-do-you-set-the-line-length-in-Visual-Studio-Code",
|
||||||
"config": [
|
"config": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "7c4cc09e-7a92-40dd-8338-b2286535c4ed",
|
"id": "7c4cc09e-7a92-40dd-8338-b2286535c4ed",
|
||||||
"snapshot": "vscode",
|
"snapshot": "vscode",
|
||||||
"instruction": "Please help me change the display language of VS Code to \"Arabic\".",
|
"instruction": "Please help me change the display language of VS Code to \"Arabic\" without using any extensions.",
|
||||||
"source": "",
|
"source": "",
|
||||||
"config": [
|
"config": [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user