Fix linting errors: Remove f-strings without placeholders and unused imports
Some checks failed
CI / test (push) Has been cancelled
Some checks failed
CI / test (push) Has been cancelled
This commit is contained in:
@@ -3,7 +3,6 @@ Code generators for different programming languages.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from typing import Optional
|
|
||||||
from .parser import ParsedCurl
|
from .parser import ParsedCurl
|
||||||
|
|
||||||
|
|
||||||
@@ -54,8 +53,8 @@ class CodeGenerators:
|
|||||||
code.append(f" auth={parsed.auth}\n")
|
code.append(f" auth={parsed.auth}\n")
|
||||||
|
|
||||||
code.append(")\n")
|
code.append(")\n")
|
||||||
code.append(f"\nprint(response.status_code)")
|
code.append("\nprint(response.status_code)")
|
||||||
code.append(f"\nprint(response.text)")
|
code.append("\nprint(response.text)")
|
||||||
|
|
||||||
return ''.join(code)
|
return ''.join(code)
|
||||||
|
|
||||||
@@ -194,7 +193,7 @@ class CodeGenerators:
|
|||||||
code.append("$ch = curl_init();\n\n")
|
code.append("$ch = curl_init();\n\n")
|
||||||
|
|
||||||
code.append("curl_setopt($ch, CURLOPT_URL, $url);\n")
|
code.append("curl_setopt($ch, CURLOPT_URL, $url);\n")
|
||||||
code.append(f"curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n")
|
code.append("curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n")
|
||||||
|
|
||||||
if parsed.method == "POST":
|
if parsed.method == "POST":
|
||||||
code.append("curl_setopt($ch, CURLOPT_POST, true);\n")
|
code.append("curl_setopt($ch, CURLOPT_POST, true);\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user