From 414baa4f489231418d1626eb3b4417dea3be7756 Mon Sep 17 00:00:00 2001 From: Nikolai Papin Date: Wed, 27 Nov 2024 19:07:03 +0300 Subject: [PATCH] Linting fixes + renamed the backend directory to match package naming conventions --- .github/workflows/pylint.yml | 2 +- .github/workflows/python-app.yml | 4 ++-- {Backend => backend}/.gitignore | 0 {Backend => backend}/Dockerfile | 0 {Backend => backend}/__init__.py | 0 {Backend => backend}/app/config.py | 2 +- .../app/exceptions/generic/configuration_exception.py | 0 {Backend => backend}/app/main.py | 0 {Backend => backend}/app/models/__init__.py | 2 +- {Backend => backend}/app/models/base.py | 6 +++--- {Backend => backend}/requirements.txt | 0 11 files changed, 8 insertions(+), 8 deletions(-) rename {Backend => backend}/.gitignore (100%) rename {Backend => backend}/Dockerfile (100%) rename {Backend => backend}/__init__.py (100%) rename {Backend => backend}/app/config.py (99%) rename {Backend => backend}/app/exceptions/generic/configuration_exception.py (100%) rename {Backend => backend}/app/main.py (100%) rename {Backend => backend}/app/models/__init__.py (98%) rename {Backend => backend}/app/models/base.py (84%) rename {Backend => backend}/requirements.txt (100%) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index e70263a..371a95c 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -15,7 +15,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install dependencies - working-directory: Backend + working-directory: backend run: | python -m pip install --upgrade pip && python -m pip install -r requirements.txt diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index b5d14b9..2b75730 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -24,13 +24,13 @@ jobs: with: python-version: "3.10" - name: Install dependencies - working-directory: Backend + working-directory: backend run: | python -m pip install --upgrade pip pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 - working-directory: Backend + working-directory: backend run: | # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics diff --git a/Backend/.gitignore b/backend/.gitignore similarity index 100% rename from Backend/.gitignore rename to backend/.gitignore diff --git a/Backend/Dockerfile b/backend/Dockerfile similarity index 100% rename from Backend/Dockerfile rename to backend/Dockerfile diff --git a/Backend/__init__.py b/backend/__init__.py similarity index 100% rename from Backend/__init__.py rename to backend/__init__.py diff --git a/Backend/app/config.py b/backend/app/config.py similarity index 99% rename from Backend/app/config.py rename to backend/app/config.py index b6344f2..e9bdbef 100644 --- a/Backend/app/config.py +++ b/backend/app/config.py @@ -61,4 +61,4 @@ handlers=[ logging.StreamHandler() # Log to console ] -) \ No newline at end of file +) diff --git a/Backend/app/exceptions/generic/configuration_exception.py b/backend/app/exceptions/generic/configuration_exception.py similarity index 100% rename from Backend/app/exceptions/generic/configuration_exception.py rename to backend/app/exceptions/generic/configuration_exception.py diff --git a/Backend/app/main.py b/backend/app/main.py similarity index 100% rename from Backend/app/main.py rename to backend/app/main.py diff --git a/Backend/app/models/__init__.py b/backend/app/models/__init__.py similarity index 98% rename from Backend/app/models/__init__.py rename to backend/app/models/__init__.py index 544cc1a..b7053b5 100644 --- a/Backend/app/models/__init__.py +++ b/backend/app/models/__init__.py @@ -12,6 +12,6 @@ def create_database(): """ logger.debug("Connecting to databse...") db.connect() - + logger.debug("Initializing tables...") db.create_tables([], safe=True) diff --git a/Backend/app/models/base.py b/backend/app/models/base.py similarity index 84% rename from Backend/app/models/base.py rename to backend/app/models/base.py index f42352d..f6f0d90 100644 --- a/Backend/app/models/base.py +++ b/backend/app/models/base.py @@ -20,13 +20,13 @@ class BaseModel(pw.Model): created_at = pw.DateTimeField(default=pnd.now()) updated_at = pw.DateTimeField(default=pnd.now()) - class Meta: + class Meta: # pylint: disable=too-few-public-methods """ Metadata for the database model """ - database = db # This model uses the PostgreSQL database + database = db def save(self, *args, **kwargs): # Update the updated_at field before saving self.updated_at = pnd.now() - return super().save(*args, **kwargs) \ No newline at end of file + return super().save(*args, **kwargs) diff --git a/Backend/requirements.txt b/backend/requirements.txt similarity index 100% rename from Backend/requirements.txt rename to backend/requirements.txt