Skip to content

Commit

Permalink
Linting fixes + renamed the backend directory to match package naming…
Browse files Browse the repository at this point in the history
… conventions
  • Loading branch information
ReallyWeirdCat committed Nov 27, 2024
1 parent 8373042 commit 414baa4
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Backend/app/config.py → backend/app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@
handlers=[
logging.StreamHandler() # Log to console
]
)
)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ def create_database():
"""
logger.debug("Connecting to databse...")
db.connect()

logger.debug("Initializing tables...")
db.create_tables([], safe=True)
6 changes: 3 additions & 3 deletions Backend/app/models/base.py → backend/app/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
return super().save(*args, **kwargs)
File renamed without changes.

0 comments on commit 414baa4

Please sign in to comment.