Skip to content

Commit

Permalink
Ignore new Prospector errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Feb 3, 2025
1 parent 5dc9f34 commit c73b0f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions c2cciutils/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class GoogleCalendar:
def __init__(self) -> None:
"""Initialize."""
self.scopes = ["https://www.googleapis.com/auth/calendar"] # in fact it is better to hard-code this
self.credentials_pickle_file = os.environ.get("TMP_CREDS_FILE", f"/tmp/{uuid.uuid4()}.pickle") # noqa: S108
self.credentials_pickle_file = os.environ.get("TMP_CREDS_FILE", f"/tmp/{uuid.uuid4()}.pickle") # noqa: S108 # nosec
self.credentials_json_file = os.environ.get(
"GOOGLE_CREDS_JSON_FILE", "~/google-credentials-c2cibot.json"
) # used to refresh the refresh_token or to initialize the credentials the first time
Expand Down Expand Up @@ -62,7 +62,7 @@ def init_calendar_service(self) -> Credentials: # type: ignore
# time.
if os.path.exists(self.credentials_pickle_file):
with open(self.credentials_pickle_file, "rb") as token:
creds = pickle.load(token) # noqa: S301
creds = pickle.load(token) # noqa: S301 # nosec
# If there are no (valid) credentials available, let the user log in.
if not creds or not creds.valid: # pylint: disable=possibly-used-before-assignment
if creds and creds.expired and creds.refresh_token:
Expand Down Expand Up @@ -99,7 +99,7 @@ def print_all_calendars(self) -> None:
# list all the calendars that the user has access to.
# used to debug credentials
print("Getting list of calendars")
calendars_result = self.service.calendarList().list().execute()
calendars_result = self.service.calendarList().list().execute() # pylint: disable=no-member

calendars = calendars_result.get("items", [])

Expand All @@ -123,7 +123,7 @@ def print_latest_events(self, time_min: Optional[datetime.datetime] = None) -> N
if not time_min:
time_min = datetime.datetime.utcnow() - datetime.timedelta(days=30)
events_result = (
self.service.events()
self.service.events() # pylint: disable=no-member
.list(
calendarId=self.calendar_id,
timeMin=time_min.isoformat() + "Z",
Expand Down Expand Up @@ -164,7 +164,7 @@ def create_event(
"end": {"dateTime": end, "timeZone": "Europe/Zurich"},
}

event_result = self.service.events().insert(calendarId=self.calendar_id, body=body).execute()
event_result = self.service.events().insert(calendarId=self.calendar_id, body=body).execute() # pylint: disable=no-member
print(f"Created event with id: {event_result['id']}")

def save_credentials_to_gopass(self) -> None:
Expand Down
6 changes: 3 additions & 3 deletions c2cciutils/scripts/docker_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def main() -> None:

# Store in /tmp/docker-logs-timestamp the current timestamp to avoid printing same logs multiple times.
timestamp_args = []
if os.path.exists("/tmp/docker-logs-timestamp"): # noqa: S108
with open("/tmp/docker-logs-timestamp", encoding="utf-8") as timestamp_file: # noqa: S108
if os.path.exists("/tmp/docker-logs-timestamp"): # noqa: S108 # nosec
with open("/tmp/docker-logs-timestamp", encoding="utf-8") as timestamp_file: # noqa: S108 # nosec
timestamp_args = [f"--since={timestamp_file.read().strip()}Z"]

with open("/tmp/docker-logs-timestamp", "w", encoding="utf-8") as timestamp_file: # noqa: S108
with open("/tmp/docker-logs-timestamp", "w", encoding="utf-8") as timestamp_file: # noqa: S108 # nosec
timestamp_file.write(datetime.utcnow().isoformat())

for name in (
Expand Down
2 changes: 1 addition & 1 deletion c2cciutils/scripts/trigger_image_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def main() -> None:

def dispatch(repository: str, event_type: str, images_full: list[str]) -> None:
"""Trigger an image update on the argocd repository."""
id_ = random.randint(1, 100000) # noqa: S311
id_ = random.randint(1, 100000) # noqa: S311 # nosec
print(f"Triggering {event_type}:{id_} on {repository} with {','.join(images_full)}")

response = requests.post(
Expand Down

0 comments on commit c73b0f1

Please sign in to comment.