Page MenuHomeDevCentral

D3734.id9658.diff
No OneTemporary

D3734.id9658.diff

diff --git a/.arclint b/.arclint
--- a/.arclint
+++ b/.arclint
@@ -23,7 +23,8 @@
"(\\.py$)"
],
"severity": {
- "E401": "warning"
+ "E401": "warning",
+ "E501": "disabled"
}
},
"flake8": {
@@ -32,6 +33,7 @@
"(\\.py$)"
],
"severity": {
+ "E501": "disabled",
"E901": "advice"
}
}
diff --git a/phabricator/analyze-repositories/coherence-check-repositories.py b/phabricator/analyze-repositories/coherence-check-repositories.py
--- a/phabricator/analyze-repositories/coherence-check-repositories.py
+++ b/phabricator/analyze-repositories/coherence-check-repositories.py
@@ -19,6 +19,7 @@
# Analyze Phabricator repositories metadata
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
def analyze_repository(repository):
id = repository["id"]
settings_url = f"{app['base_url']}/diffusion/edit/{id}/page/basics/"
@@ -28,31 +29,39 @@
if repository["fields"]["defaultBranch"] == "master":
issues.append(
- ("defaultBranch-master",
- "Has still a master branch. Rename it to main."))
+ ("defaultBranch-master", "Has still a master branch. Rename it to main.")
+ )
if not short_name:
issues.append(
- ("shortName-missing",
- f"Short name is missing. Add one here: {settings_url}"))
+ (
+ "shortName-missing",
+ f"Short name is missing. Add one here: {settings_url}",
+ )
+ )
if not contains_github_url(repository):
- issues.append(
- ("github-missing", "Repository should be mirrored to GitHub"))
+ issues.append(("github-missing", "Repository should be mirrored to GitHub"))
else:
if short_name:
github_name = get_github_repository_name(repository)
if short_name != github_name:
issues.append(
- ("github-invalidName",
- f"Repository is called {short_name} on Phabricator but {github_name} on GitHub."))
+ (
+ "github-invalidName",
+ f"Repository is called {short_name} on Phabricator but {github_name} on GitHub.",
+ )
+ )
url_id, has_valid_io = check_github_io(repository)
if not has_valid_io:
url_url = f"{app['base_url']}/diffusion/{call_sign}/uri/edit/{url_id}/"
issues.append(
- ("github-io-mirror",
- f"GitHub URL isn't configured as a mirror. Edit here: {url_url}"))
+ (
+ "github-io-mirror",
+ f"GitHub URL isn't configured as a mirror. Edit here: {url_url}",
+ )
+ )
if issues:
app["issues"][repository["fields"]["callsign"]] = issues
@@ -84,21 +93,21 @@
def contains_github_url(repository):
for uri in repository["attachments"]["uris"]["uris"]:
- if 'github.com/' in uri["fields"]["uri"]["normalized"]:
+ if "github.com/" in uri["fields"]["uri"]["normalized"]:
return True
def get_github_repository_name(repository):
for uri in repository["attachments"]["uris"]["uris"]:
url = uri["fields"]["uri"]["normalized"]
- if 'github.com/' in url:
+ if "github.com/" in url:
# Normalized URL is github.com/<account>/<repo>, take last part
return url.split("/")[-1]
def check_github_io(repository):
for uri in repository["attachments"]["uris"]["uris"]:
- if 'github.com/' in uri["fields"]["uri"]["normalized"]:
+ if "github.com/" in uri["fields"]["uri"]["normalized"]:
return uri["id"], uri["fields"]["io"]["effective"] == "mirror"
@@ -124,8 +133,9 @@
try:
repositories_path = sys.argv[1]
except IndexError:
- print("Usage:", sys.argv[0],
- "<repositories API response file>", file=sys.stderr)
+ print(
+ "Usage:", sys.argv[0], "<repositories API response file>", file=sys.stderr
+ )
sys.exit(2)
run(repositories_path)

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 13, 01:41 (14 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3069853
Default Alt Text
D3734.id9658.diff (4 KB)

Event Timeline