Skip to content

Commit 052ce9c

Browse files
committed
style: change docstring style
1 parent d2f9131 commit 052ce9c

File tree

8 files changed

+17
-28
lines changed

8 files changed

+17
-28
lines changed

.vscode/settings.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,21 @@
66
"-p",
77
"test_*.py"
88
],
9+
"pythonTestExplorer.testFramework": "pytest",
910
"python.testing.pytestEnabled": false,
10-
"python.testing.unittestEnabled": true,
11+
"python.testing.pytestArgs": [
12+
"--doctest-modules",
13+
"src"
14+
],
15+
"python.testing.unittestEnabled": false,
1116
"[python]": {
1217
"editor.defaultFormatter": "charliermarsh.ruff",
1318
"editor.formatOnSave": true,
1419
"editor.codeActionsOnSave": {
1520
"source.organizeImports": "explicit"
1621
},
1722
},
18-
"isort.args": [
19-
"--profile",
20-
"black"
21-
],
2223
"terminal.integrated.env.linux": {
2324
"PYTHONPATH": "${workspaceFolder}:${workspaceFolder}/src"
24-
},
25-
"makefile.makefilePath": "docs/Makefile",
26-
"makefile.configureOnOpen": false
25+
}
2726
}

src/mastermind/core/models/game.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
@dataclass
1111
class Game:
12-
"""
13-
Dataclass for a game.
12+
"""Dataclass for a game.
1413
1514
This class encapsulates all the essential information about a game, including the game board, configuration, entities, and current state.
1615

src/mastermind/core/models/game_configuration.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
@dataclass(frozen=True)
77
class GameConfiguration:
8-
"""
9-
Dataclass for the configuration of a game.
8+
"""Dataclass for the configuration of a game.
109
1110
This class defines the settings that determine how a game is structured, including the number of colors, dots, allowed attempts, and game mode.
1211

src/mastermind/core/models/game_entities.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
@dataclass(frozen=True)
88
class GameEntities:
9-
"""
10-
Dataclass for the entities of a game (such as players or those from plugins).
9+
"""Dataclass for the entities of a game (such as players or those from plugins).
1110
1211
This class represents the key participants in a game, specifically the players involved in setting and breaking the code. It serves as a structured way to manage and reference these entities throughout the game's lifecycle.
1312

src/mastermind/core/models/game_mode.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55

66
class GameMode(Enum):
7-
"""
8-
Enum for the different game modes, which determined who is Player 1 and who is Player 2.
7+
"""Enum for the different game modes, which determined who is Player 1 and who is Player 2.
98
109
Members:
1110
PVP: Player versus player mode.

src/mastermind/core/models/game_round.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
@dataclass(frozen=True)
66
class GameRound:
7-
"""
8-
Dataclass for a single round of the game.
7+
""" for a single round of the game.
98
109
This class encapsulates the guess made during a round and the corresponding feedback received.
1110

src/mastermind/core/models/game_state.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
@dataclass
88
class GameState:
9-
"""
10-
Dataclass for maintaining the current state of the game, indicating whether the game has started, if it is over, and who won.
9+
"""Dataclass for maintaining the current state of the game, indicating whether the game has started, if it is over, and who won.
1110
1211
Attributes:
1312
game_started (bool): A flag indicating if the game has started.

src/mastermind/core/models/gameboard.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
@dataclass(frozen=True)
1010
class GameBoard:
11-
"""
12-
Dataclass for the gameboard of a game.
11+
"""Dataclass for the gameboard of a game.
1312
1413
This class represents the collection of game rounds that have taken place during a game session. It serves as a structured way to manage and track the progression of the game through its various rounds.
1514
@@ -20,8 +19,7 @@ class GameBoard:
2019
game_rounds: Deque[GameRound]
2120

2221
def __len__(self) -> int:
23-
"""
24-
Returns the number of game rounds in the game board.
22+
"""Returns the number of game rounds in the game board.
2523
2624
Returns:
2725
int: Number of game rounds in the game board.
@@ -35,8 +33,7 @@ def __len__(self) -> int:
3533

3634
@property
3735
def guesses(self) -> Generator[Tuple[int, ...], None, None]:
38-
"""
39-
Returns a generator of all guesses made in the game to allow for easy iteration.
36+
"""Returns a generator of all guesses made in the game to allow for easy iteration.
4037
4138
Returns:
4239
Generator[Tuple[int, ...], None, None]: A generator of all guesses made in the game.
@@ -52,8 +49,7 @@ def guesses(self) -> Generator[Tuple[int, ...], None, None]:
5249

5350
@property
5451
def feedbacks(self) -> Generator[Tuple[int, int], None, None]:
55-
"""
56-
Returns a generator of all feedbacks received in the game to allow for easy iteration.
52+
"""Returns a generator of all feedbacks received in the game to allow for easy iteration.
5753
5854
Yields:
5955
Generator[Tuple[int], None, None]: A generator of all feedbacks received in the game.

0 commit comments

Comments
 (0)