Skip to content
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
9 changes: 0 additions & 9 deletions .env.local

This file was deleted.

6 changes: 6 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MODE=local
MONGO_URI=mongodb://<username>:<password>@127.0.0.1:27017/?authSource=admin&retryWrites=true&w=majority
DOMAIN=https://localhost:8001
PORT=8001
API_VERSION=""
APP_NAMe="LOCAL"
28 changes: 14 additions & 14 deletions .githooks/post-checkout
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash
set -e

# DRY RUN GUARD
if [ "$DRY_RUN" = "1" ]; then
echo "[DRY RUN] Hook executed: $(basename "$0")"
exit 0
fi

git diff --name-only HEAD@{1} HEAD | grep -q "poetry.lock" || exit 0

echo "[post-checkout] regenerating requirements.txt"

poetry export -f requirements.txt -o requirements.txt --without-hashes
#!/bin/bash
set -e
# DRY RUN GUARD
if [ "$DRY_RUN" = "1" ]; then
echo "[DRY RUN] Hook executed: $(basename "$0")"
exit 0
fi
git diff --name-only HEAD@{1} HEAD | grep -q "poetry.lock" || exit 0
echo "[post-checkout] regenerating requirements.txt"
poetry export -f requirements.txt -o requirements.txt --without-hashes
24 changes: 12 additions & 12 deletions .githooks/post-merge
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
set -e

# DRY RUN GUARD
if [ "$DRY_RUN" = "1" ]; then
echo "[DRY RUN] Hook executed: $(basename "$0")"
exit 0
fi

git diff --name-only HEAD@{1} HEAD | grep -q "poetry.lock" || exit 0
echo "[post-merge] regenerating requirements.txt"
poetry export -f requirements.txt -o requirements.txt --without-hashes
#!/bin/bash
set -e
# DRY RUN GUARD
if [ "$DRY_RUN" = "1" ]; then
echo "[DRY RUN] Hook executed: $(basename "$0")"
exit 0
fi
git diff --name-only HEAD@{1} HEAD | grep -q "poetry.lock" || exit 0
echo "[post-merge] regenerating requirements.txt"
poetry export -f requirements.txt -o requirements.txt --without-hashes
104 changes: 52 additions & 52 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
#!/bin/bash

# ---- DRY RUN MODE ----
if [ "$DRY_RUN" = "1" ]; then
echo "[DRY RUN] Hook executed: $(basename "$0")"
exit 0
fi
# ---------------------
# Step 1: Validate branch naming convention
BRANCH_NAME=$(git symbolic-ref --short HEAD)
echo "Current branch: $BRANCH_NAME"

# Define the branches to exclude
EXCLUDED_BRANCHES="develop main release"

# Check if the current branch is in the excluded list
for EXCLUDED_BRANCH in $EXCLUDED_BRANCHES; do
if [ "$BRANCH_NAME" = "$EXCLUDED_BRANCH" ]; then
echo "Skipping pre-commit checks for branch: $BRANCH_NAME"
exit 0
fi
done

# Pre-commit checks (e.g., linting, testing, etc.)
echo "Running pre-commit checks for branch: $BRANCH_NAME"

echo "$BRANCH_NAME" | grep -Eq '^(feature|bugfix|hotfix)/[A-Za-z]+-[0-9]+'
if [ $? -ne 0 ]; then
echo "Error: Branch name '$BRANCH_NAME' is invalid."
echo "Use a valid branch naming convention, e.g., feature/XYZ-123-description."
exit 1
fi

# Step 2: Run poetry linting tools
echo "Running poetry linting tools..."
if ! poetry run flake8 .; then
echo "flake8 failed. Aborting commit."
exit 1
fi

if ! poetry run black .; then
echo "black failed. Aborting commit."
exit 1
fi

#if ! poetry run mypy .; then
# echo "mypy failed. Aborting commit."
# exit 1
#fi

echo "Pre-commit checks passed!"
exit 0
#!/bin/bash
# ---- DRY RUN MODE ----
if [ "$DRY_RUN" = "1" ]; then
echo "[DRY RUN] Hook executed: $(basename "$0")"
exit 0
fi
# ---------------------
# Step 1: Validate branch naming convention
BRANCH_NAME=$(git symbolic-ref --short HEAD)
echo "Current branch: $BRANCH_NAME"
# Define the branches to exclude
EXCLUDED_BRANCHES="develop main release"
# Check if the current branch is in the excluded list
for EXCLUDED_BRANCH in $EXCLUDED_BRANCHES; do
if [ "$BRANCH_NAME" = "$EXCLUDED_BRANCH" ]; then
echo "Skipping pre-commit checks for branch: $BRANCH_NAME"
exit 0
fi
done
# Pre-commit checks (e.g., linting, testing, etc.)
echo "Running pre-commit checks for branch: $BRANCH_NAME"
echo "$BRANCH_NAME" | grep -Eq '^(feature|bugfix|hotfix)/[A-Za-z]+-[0-9]+'
if [ $? -ne 0 ]; then
echo "Error: Branch name '$BRANCH_NAME' is invalid."
echo "Use a valid branch naming convention, e.g., feature/XYZ-123-description."
exit 1
fi
# Step 2: Run poetry linting tools
echo "Running poetry linting tools..."
if ! poetry run flake8 .; then
echo "flake8 failed. Aborting commit."
exit 1
fi
if ! poetry run black .; then
echo "black failed. Aborting commit."
exit 1
fi
#if ! poetry run mypy .; then
# echo "mypy failed. Aborting commit."
# exit 1
#fi
echo "Pre-commit checks passed!"
exit 0
34 changes: 17 additions & 17 deletions .githooks/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/bash

# This script prepends the branch name to the commit message
# Skip certain branches (configurable)
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP="master develop release"
fi

BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"

BRANCH_EXCLUDED=$(printf "%s\n" $BRANCHES_TO_SKIP | grep -c "^$BRANCH_NAME$")
BRANCH_IN_COMMIT=$(grep -c "\[$BRANCH_NAME\]" "$1")

if [ -n "$BRANCH_NAME" ] && ! [ $BRANCH_EXCLUDED -eq 1 ] && ! [ $BRANCH_IN_COMMIT -ge 1 ]; then
sed -i.bak -e "1s/^/[$BRANCH_NAME]: /" "$1"
fi
#!/bin/bash
# This script prepends the branch name to the commit message
# Skip certain branches (configurable)
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP="master develop release"
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
BRANCH_EXCLUDED=$(printf "%s\n" $BRANCHES_TO_SKIP | grep -c "^$BRANCH_NAME$")
BRANCH_IN_COMMIT=$(grep -c "\[$BRANCH_NAME\]" "$1")
if [ -n "$BRANCH_NAME" ] && ! [ $BRANCH_EXCLUDED -eq 1 ] && ! [ $BRANCH_IN_COMMIT -ge 1 ]; then
sed -i.bak -e "1s/^/[$BRANCH_NAME]: /" "$1"
fi
12 changes: 6 additions & 6 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

* @recursivezero

# You can also use email addresses if you prefer

docs/* recursivelyzero@gmail.com
* @recursivezero
# You can also use email addresses if you prefer
docs/* recursivelyzero@gmail.com
Loading