Skip to content

Commit

Permalink
tune pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
ptichoid committed Jun 4, 2024
1 parent fa573d9 commit ca96529
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 23 deletions.
10 changes: 7 additions & 3 deletions ecosystem_issues.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import os
import psycopg2
from github import Github
"""
This script gathers info about github issues in infra repos, for ecosystem squad
"""

import time
import logging
from datetime import datetime, timedelta
import os
import psycopg2
from github import Github

logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

Expand Down
10 changes: 7 additions & 3 deletions failed_zuul.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
"""
This script gathers info regarding PRs, which check jobs in zuul has been failed
"""

from datetime import datetime
import time
import logging
import os
import requests
import json
import re
import psycopg2
from datetime import datetime
import time
import logging

logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

Expand Down
8 changes: 6 additions & 2 deletions gitea_info.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
"""
This script gather and process info about dependent PRs, its parents and store it in postgres table
"""

import time
import logging
import os
import requests
import json
Expand All @@ -6,8 +12,6 @@
import pathlib
import psycopg2
from github import Github
import time
import logging

logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

Expand Down
8 changes: 6 additions & 2 deletions github_info.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
"""
This script retrieves info about parent PRs on Github
"""

import time
import logging
import os
import requests
import re
import psycopg2
from github import Github
import time
import logging

logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

Expand Down
15 changes: 10 additions & 5 deletions last_commit_info.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
"""
This script provides logic to retrieve info about last date when document was updated
"""

from datetime import datetime
import time
import logging
import os
import shutil
import tempfile
import psycopg2
from github import Github
from datetime import datetime
import time
import logging


logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

Expand All @@ -30,7 +35,7 @@ def check_env_variables():
]
for var in required_env_vars:
if os.getenv(var) is None:
raise Exception(f"Missing environment variable: {var}")
raise Exception("Missing environment variable: %s", var)


def connect_to_db(db_name):
Expand All @@ -44,7 +49,7 @@ def connect_to_db(db_name):
password=db_password
)
except psycopg2.Error as e:
logging.error(f"Connecting to Postgres: an error occurred while trying to connect to the database: {e}")
logging.error("Connecting to Postgres: an error occurred while trying to connect to the database: %s", e)
return None


Expand Down
11 changes: 8 additions & 3 deletions open_issues.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
"""
This script gather info regarding open issues in Gitea and Github
"""

import requests
import time
import logging
import json
import re
import os
import psycopg2
from datetime import datetime
from github import Github
import requests
import time
import logging


logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

Expand Down
9 changes: 7 additions & 2 deletions otc_services_dict.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
"""
This script gather and process info about all services in OTC, both public and hybrid, process it and store in
service postgres tables, to match repo names, service full names and its squads
"""

import time
import logging
import os
import requests
import yaml
import base64
import psycopg2
import time
import logging

logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

Expand Down
8 changes: 6 additions & 2 deletions scheduler.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
"""
This script sends Zulip messages to a corresponding squads via Zulip bot, based on info taken from postgres tables
"""

from datetime import datetime
from urllib.parse import quote
import os
import psycopg2
import time
import logging
from psycopg2.extras import DictCursor
import zulip
from datetime import datetime
from urllib.parse import quote

logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ deps =
isort
commands =
flake8 . --max-line-length=120
pylint --max-line-length=120 *.py
pylint --max-line-length=120 --fail-under=8 *.py
mypy .
isort . --check-only --line-length 120

0 comments on commit ca96529

Please sign in to comment.