mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 03:32:23 +08:00
chore: skip PLR6201 linter rule (#8666)
This commit is contained in:
parent
4c7beb9d7b
commit
86f90fd9ff
|
@ -35,10 +35,10 @@ class CrawlTool(BuiltinTool):
|
|||
scrapeOptions["excludeTags"] = get_array_params(tool_parameters, "excludeTags")
|
||||
scrapeOptions["onlyMainContent"] = tool_parameters.get("onlyMainContent", False)
|
||||
scrapeOptions["waitFor"] = tool_parameters.get("waitFor", 0)
|
||||
scrapeOptions = {k: v for k, v in scrapeOptions.items() if v not in {None, ""}}
|
||||
scrapeOptions = {k: v for k, v in scrapeOptions.items() if v not in (None, "")}
|
||||
payload["scrapeOptions"] = scrapeOptions or None
|
||||
|
||||
payload = {k: v for k, v in payload.items() if v not in {None, ""}}
|
||||
payload = {k: v for k, v in payload.items() if v not in (None, "")}
|
||||
|
||||
crawl_result = app.crawl_url(url=tool_parameters["url"], wait=wait_for_results, **payload)
|
||||
|
||||
|
|
|
@ -29,10 +29,10 @@ class ScrapeTool(BuiltinTool):
|
|||
extract["schema"] = get_json_params(tool_parameters, "schema")
|
||||
extract["systemPrompt"] = tool_parameters.get("systemPrompt")
|
||||
extract["prompt"] = tool_parameters.get("prompt")
|
||||
extract = {k: v for k, v in extract.items() if v not in {None, ""}}
|
||||
extract = {k: v for k, v in extract.items() if v not in (None, "")}
|
||||
payload["extract"] = extract or None
|
||||
|
||||
payload = {k: v for k, v in payload.items() if v not in {None, ""}}
|
||||
payload = {k: v for k, v in payload.items() if v not in (None, "")}
|
||||
|
||||
crawl_result = app.scrape_url(url=tool_parameters["url"], **payload)
|
||||
markdown_result = crawl_result.get("data", {}).get("markdown", "")
|
||||
|
|
|
@ -28,7 +28,6 @@ select = [
|
|||
"PLR0402", # manual-from-import
|
||||
"PLR1711", # useless-return
|
||||
"PLR1714", # repeated-equality-comparison
|
||||
"PLR6201", # literal-membership
|
||||
"RUF019", # unnecessary-key-check
|
||||
"RUF100", # unused-noqa
|
||||
"RUF101", # redirected-noqa
|
||||
|
|
Loading…
Reference in New Issue
Block a user