Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add formatted __init__ #70

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ jobs:
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,6 @@ tracker.db

# Ignore pyenv files
.python-version

# Exclude runner
runner.sh
2 changes: 2 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tool.isort]
profile = "black"
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 22.6.0
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black"]
471 changes: 4 additions & 467 deletions GitHub_Tools_List.csv

Large diffs are not rendered by default.

102 changes: 99 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ requests = "^2.31.0"
rich = "^12.4.4"
python-dotenv = "^0.20.0"
xlrd = "^2.0.1"
cyclonedx-bom = "^3.10.1"

[tool.poetry.dev-dependencies]
pytest = "^7.1.2"
Expand Down
1 change: 1 addition & 0 deletions sbom.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions sbom.xml

Large diffs are not rendered by default.

42 changes: 22 additions & 20 deletions src/ratatoskr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@
__version__ = "0.5.0"
__prog__ = "ratatoskr.py"

from ratatoskr import verify_environment
from ratatoskr import get_ratelimit_status
from ratatoskr import get_urls
from ratatoskr import get_gitlab_latest_release
from ratatoskr import get_gitlab_latest_commit
from ratatoskr import get_latest_release
from ratatoskr import get_latest_commit
from ratatoskr import update_tracker
from ratatoskr import insert_repo
from ratatoskr import confirm_table
from ratatoskr import delete_repo
from ratatoskr import confirm_repo
from ratatoskr import bootstrap_db
from ratatoskr import dump_table
from ratatoskr import read_repositories
from ratatoskr import save_messages
from ratatoskr import send_webhook
from ratatoskr import parse_arguments
from ratatoskr import prepare_database
from ratatoskr import main
from ratatoskr import (
bootstrap_db,
confirm_repo,
confirm_table,
delete_repo,
dump_table,
get_gitlab_latest_commit,
get_gitlab_latest_release,
get_latest_commit,
get_latest_release,
get_ratelimit_status,
get_urls,
insert_repo,
main,
parse_arguments,
prepare_database,
read_repositories,
save_messages,
send_webhook,
update_tracker,
verify_environment,
)
4 changes: 2 additions & 2 deletions src/ratatoskr/convert_to_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
# This python script is to extract each sheet in an Excel workbook as a new csv file

import csv
import xlrd
import sys

import xlrd


def ExceltoCSV(excel_file, csv_file):
"""Convert Excel XLS file to CSV"""
Expand All @@ -15,7 +16,6 @@ def ExceltoCSV(excel_file, csv_file):

# Iterate over each tab/sheet name
for sheet_name in workbook.sheet_names():

print(f"[-] INFO Processing sheet name - {sheet_name}")

# Define our worksheet by index
Expand Down
8 changes: 4 additions & 4 deletions src/ratatoskr/ratatoskr.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def verify_gitlab_token(session):

# If we don't have 2XX status code
if not response.ok:

# Check if we have expired GitLab Token
if response_json["message"] == "401 Unauthorized":
console.print(
Expand Down Expand Up @@ -504,9 +503,10 @@ def send_webhook(message, webhook_url, provider, filename):
# https://docs.rocket.chat/guides/administration/admin-panel/integrations
if provider == "rocketchat":
data = {
"username": "rocket.cat",
"icon_emoji": ":chipmunk:",
"attachments": [{"text": message, "color": "#764FA5"}],
"emoji": ":chipmunk:",
"attachments": [
{"title": "ratatoskr notify", "text": message, "color": "#764FA5"}
],
}

# HTTP POST to our Webhook URL
Expand Down
1 change: 1 addition & 0 deletions src/tests/ratatoskr_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from ratatoskr import verify_environment


Expand Down
Loading