Skip to content

Commit

Permalink
Merge pull request #2653 from skanda890/main
Browse files Browse the repository at this point in the history
Create .deepsource.toml, .whitesource, and Update WebBasedData/test_urls.py
  • Loading branch information
marticliment authored Aug 28, 2024
2 parents 76ed941 + 38b0bf8 commit 2bc5948
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 2 deletions.
65 changes: 65 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
version = 1

[[analyzers]]
name = "python"
enabled = true

[analyzers.meta]
runtime_version = "3.x.x"

[analyzers.pylint]
enabled = true
config = """
[MESSAGES CONTROL]
disable = C0111 # Disables missing docstring warnings
"""

[[analyzers]]
name = "javascript"
enabled = true

[analyzers.meta]
plugins = [
"react",
"vue",
"angular"
]
environment = [
"nodejs",
"mocha",
"mongo",
"browser",
"jasmine",
"cypress",
"vitest",
"jquery",
"jest"
]

[[transformers]]
name = "autopep8"
enabled = false # Disables autopep8 transformer

[[transformers]]
name = "isort"
enabled = false # Disables isort transformer

[[transformers]]
name = "black"
enabled = false # Disables black transformer

[[transformers]]
name = "yapf"
enabled = false # Disables yapf transformer

[[transformers]]
name = "ruff"
enabled = false # Disables ruff transformer

[[transformers]]
name = "standardjs"
enabled = false # Disables standardjs transformer

[[transformers]]
name = "prettier"
enabled = false # Disables prettier transformer
14 changes: 14 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"scanSettings": {
"baseBranches": []
},
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "failure",
"displayMode": "diff",
"useMendCheckNames": true
},
"issueSettings": {
"minSeverityLevel": "LOW",
"issueType": "DEPENDENCY"
}
}
4 changes: 2 additions & 2 deletions WebBasedData/test_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
print("Package failed:", package, data["icons_and_screenshots"][package]["icon"])
with open("invalid_urls.txt", "a") as f:
f.write(data["icons_and_screenshots"][package]["icon"] + "\n")
elif response.status_code != 200 and response.status_code != 403:
elif response.status_code not in (200, 403):
print(response.status_code, "failed for:", data["icons_and_screenshots"][package]["icon"])

except requests.exceptions.ConnectionError:
time.sleep(0.1)
try:
if data["icons_and_screenshots"][package]["icon"] != "":
response = requests.get(data["icons_and_screenshots"][package]["icon"])
if response.status_code == 403 or response.status_code == 404:
if response.status_code in (403, 404):
print("Package failed:", package, data["icons_and_screenshots"][package]["icon"])
elif response.status_code != 200:
response = requests.get(data["icons_and_screenshots"][package]["icon"])
Expand Down

0 comments on commit 2bc5948

Please sign in to comment.