-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring/13 documentation and formatting #30
Changes from 9 commits
8e1b161
0a0498d
96a1a5a
f06dc31
be75de8
f6802f3
d678e81
0677c53
7c0f8c1
b3e3d99
eb6b679
e465f58
a22f30e
c39b54b
0b29d27
7708806
d5e2d21
b9e4d68
5db1778
0bdbf9b
c807e2c
9c49482
b70f0e9
56d941e
a9def3f
830ccc6
3cdfef6
fdafc07
1324bc6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,19 +15,16 @@ | |
# | ||
|
||
""" | ||
This module contains the ActionInputs class which is responsible for loading, managing and validating the inputs | ||
required for running the GH Action. | ||
This module contains an Action Inputs class methods, | ||
which are essential for running the GH action. | ||
""" | ||
|
||
import json | ||
import logging | ||
import sys | ||
|
||
from living_documentation_generator.model.config_repository import ConfigRepository | ||
from living_documentation_generator.utils.utils import ( | ||
get_action_input, | ||
make_absolute_path, | ||
) | ||
from living_documentation_generator.utils.utils import get_action_input, make_absolute_path | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From how many import items are required ()? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whenever line is more than 120 char. The rules are still same. BUT If we talking about for example constants, which can increase during the time, I also think is alright to put them under each other. Black way of formatting is to reduce as many extra lines as possible. But it won't change your code, if you choose to put just two of your imports under each other. |
||
from living_documentation_generator.utils.constants import ( | ||
GITHUB_TOKEN, | ||
PROJECT_STATE_MINING, | ||
|
@@ -40,14 +37,10 @@ | |
|
||
class ActionInputs: | ||
""" | ||
A class representing all inputs that are essential for running the GH action. | ||
|
||
Attributes: | ||
__github_token (str): The GitHub token used for authentication. | ||
__is_project_state_mining_enabled (bool): Switch indicating if project state mining is enabled. | ||
__repositories (list[ConfigRepository]): List of config repositories to fetch from. | ||
__output_directory (str): The directory where the markdown pages will be stored. | ||
A class representing all the action inputs. It is responsible for loading, managing | ||
and validating the inputs required for running the GH Action. | ||
""" | ||
|
||
def __init__(self): | ||
self.__github_token: str = "" | ||
self.__is_project_state_mining_enabled: bool = False | ||
|
@@ -78,13 +71,11 @@ def load_from_environment(self, validate: bool = True) -> "ActionInputs": | |
""" | ||
Load the action inputs from the environment variables and validate them if needed. | ||
|
||
Args: | ||
validate (bool): Switch indicating if the inputs should be validated. | ||
@param validate: Switch indicating if the inputs should be validated. | ||
@return: The instance of the ActionInputs class. | ||
""" | ||
self.__github_token = get_action_input(GITHUB_TOKEN) | ||
self.__is_project_state_mining_enabled = ( | ||
get_action_input(PROJECT_STATE_MINING, "false").lower() == "true" | ||
) | ||
self.__is_project_state_mining_enabled = get_action_input(PROJECT_STATE_MINING, "false").lower() == "true" | ||
out_path = get_action_input(OUTPUT_PATH, "./output") | ||
self.__output_directory = make_absolute_path(out_path) | ||
repositories_json = get_action_input(REPOSITORIES, "") | ||
|
@@ -115,8 +106,8 @@ def validate_inputs(self, repositories_json: str) -> None: | |
""" | ||
Validate the input attributes of the action. | ||
|
||
Args: | ||
repositories_json(str): The JSON string containing the repositories to fetch. | ||
@param repositories_json: The JSON string containing the repositories to fetch. | ||
@return: None | ||
""" | ||
|
||
# Validate correct format of input repositories_json | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change as well as for Pylint tool: fdafc07