Skip to content

Commit

Permalink
added special linting rules where necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
AronBuzogany committed Feb 23, 2024
1 parent 30eded8 commit 197b274
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 11 deletions.
1 change: 0 additions & 1 deletion backend/project/models/course_relations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Models for relation between users and courses"""
# pylint: disable=too-few-public-methods

from sqlalchemy import Integer, Column, ForeignKey, PrimaryKeyConstraint, String
from project import db
Expand Down
2 changes: 1 addition & 1 deletion backend/project/models/courses.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""The Courses model"""
# pylint: disable=too-few-public-methods

from sqlalchemy import Integer, Column, ForeignKey, String
from project import db

Expand Down
2 changes: 1 addition & 1 deletion backend/project/models/projects.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Model for projects"""
# pylint: disable=too-few-public-methods

from sqlalchemy import ARRAY, Boolean, Column, DateTime, ForeignKey, Integer, String, Text
from project import db

Expand Down
2 changes: 1 addition & 1 deletion backend/project/models/submissions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Model for submissions"""
# pylint: disable=too-few-public-methods

from sqlalchemy import Column,String,ForeignKey,Integer,CheckConstraint,DateTime,Boolean
from project import db

Expand Down
2 changes: 1 addition & 1 deletion backend/project/models/users.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Model for users"""
# pylint: disable=too-few-public-methods

from sqlalchemy import Boolean, Column, String
from project import db

Expand Down
10 changes: 9 additions & 1 deletion backend/pylintrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
[MASTER]
init-hook='import sys; sys.path.append(".")'
init-hook='import sys; sys.path.append(".")'

[test-files:*_test.py]
disable=
W0621, # Redefining name %r from outer scope (line %s)

[modules:project/modules/*]
disable=
R0903 # Too few public methods (modules don't require us to have public methods)
4 changes: 2 additions & 2 deletions backend/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ def app():
Returns:
Flask -- A Flask application instance
"""
app = create_app() # pylint: disable=redefined-outer-name ; fixture testing requires the same name to be used
app = create_app()
yield app

@pytest.fixture
def client(app): # pylint: disable=redefined-outer-name ; fixture testing requires the same name to be used
def client(app):
"""A fixture that creates a test client for the app.
Arguments:
app {Flask} -- A Flask application instance
Expand Down
6 changes: 3 additions & 3 deletions backend/tests/models/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def course_teacher():
return sel2_teacher

@pytest.fixture
def course(course_teacher): # pylint: disable=redefined-outer-name ; fixture testing requires the same name to be used
def course(course_teacher):
"""A course for testing, with the course teacher as the teacher."""
sel2 = Courses(name="Sel2", teacher=course_teacher.uid)
return sel2
Expand All @@ -81,7 +81,7 @@ def course_students():
return students

@pytest.fixture
def course_students_relation(course,course_students): # pylint: disable=redefined-outer-name
def course_students_relation(course,course_students):
"""A list of 5 course relations for testing."""
course_relations = [
CourseStudents(course_id=course.course_id, uid=course_students[i].uid)
Expand All @@ -96,7 +96,7 @@ def assistent():
return assist

@pytest.fixture()
def course_admin(course,assistent): # pylint: disable=redefined-outer-name ; fixture testing requires the same name to be used
def course_admin(course,assistent):
"""A course admin for testing."""
admin_relation = CourseAdmins(uid=assistent.uid, course_id=course.course_id)
return admin_relation
Expand Down

0 comments on commit 197b274

Please sign in to comment.