Skip to content

Commit

Permalink
ci: initial support
Browse files Browse the repository at this point in the history
added ruff
  • Loading branch information
THEBAULT Julien authored and Lujeni committed Aug 23, 2024
1 parent 5d99ebc commit 287a5ab
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Run Ruff
run: ruff check --output-format=github .
9 changes: 4 additions & 5 deletions gitlab2rbac.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/python env

import logging
from collections import defaultdict
from os import environ
Expand Down Expand Up @@ -27,7 +25,8 @@ class GitlabHelper(object):
20: "reporter",
30: "developer",
40: "maintainer",
50: "maintainer", # NOTE: owner is only usable when your permissions are based on group.
# NOTE: owner is only usable when your permissions are based on group.
50: "maintainer",
}

def __init__(
Expand Down Expand Up @@ -130,7 +129,7 @@ def get_admins(self):
return []

def check_user(self, user):
if user["bot"] == True:
if user["bot"] is True:
logging.debug(f"Ignore user {user['username']} because it's a bot")
return False
if user["username"] in self.username_ignore_list:
Expand All @@ -151,7 +150,7 @@ def _get_users_query_paginated(
if variable_values is None:
variable_values = {}
variable_values["first"] = 50
raw = gql_client.execute(
gql_client.execute(
query, variable_values=variable_values, parse_result=True
)
nodes = []
Expand Down

0 comments on commit 287a5ab

Please sign in to comment.