goodbye pydocstyle, more lint
This commit is contained in:
parent
92961c8f58
commit
bb6829a4bc
5 changed files with 40 additions and 12 deletions
4
Makefile
4
Makefile
|
|
@ -17,12 +17,10 @@ lint:
|
|||
@-isort .
|
||||
@-black .
|
||||
@-pylint src/
|
||||
@-pydocstyle src/*
|
||||
check_lint:
|
||||
isort . --check-only --diff \
|
||||
&& black . --check \
|
||||
&& pylint src/ \
|
||||
&& pydocstyle src/*
|
||||
&& pylint src/
|
||||
wheel: clean
|
||||
$(shell echo "__pypi_version__ = \"$(PYPI_VERSION)\"\n__local_version__ = \"$(LOCAL_VERSION)\"" > src/ytdl_sub/__init__.py)
|
||||
cat src/ytdl_sub/__init__.py
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ lint =
|
|||
black==22.3.0
|
||||
isort==5.10.1
|
||||
pylint==2.13.5
|
||||
pydocstyle[toml]==6.1.1
|
||||
docs =
|
||||
sphinx==4.5.0
|
||||
sphinx-rtd-theme==1.0.0
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
# pylint: disable=missing-raises-doc
|
||||
from typing import Dict
|
||||
from typing import List
|
||||
from typing import Optional
|
||||
|
|
@ -18,8 +19,6 @@ from ytdl_sub.script.utils.exceptions import RuntimeException
|
|||
from ytdl_sub.script.utils.name_validation import validate_variable_name
|
||||
from ytdl_sub.script.utils.type_checking import FunctionSpec
|
||||
|
||||
# pylint: disable=missing-raises-doc
|
||||
|
||||
|
||||
def _is_function(override_name: str):
|
||||
return override_name.startswith("%")
|
||||
|
|
@ -421,7 +420,8 @@ class Script:
|
|||
|
||||
Returns
|
||||
-------
|
||||
Dict containing the variable names to their resolved values.
|
||||
Dict[str, Resolvable]
|
||||
Dict containing the variable names to their resolved values.
|
||||
"""
|
||||
try:
|
||||
self.add(variable_definitions)
|
||||
|
|
@ -436,6 +436,22 @@ class Script:
|
|||
del self._variables[name]
|
||||
|
||||
def get(self, variable_name: str) -> Resolvable:
|
||||
"""
|
||||
Parameters
|
||||
----------
|
||||
variable_name
|
||||
Name of the resolved variable to get.
|
||||
|
||||
Returns
|
||||
-------
|
||||
Resolvable
|
||||
The resolved variable of the given name.
|
||||
|
||||
Raises
|
||||
------
|
||||
RuntimeException
|
||||
If the variable has not been resolved yet in the Script.
|
||||
"""
|
||||
if variable_name not in self._variables:
|
||||
raise RuntimeException(
|
||||
f"Tried to get resolved variable {variable_name}, but it does not exist"
|
||||
|
|
@ -448,4 +464,10 @@ class Script:
|
|||
|
||||
@property
|
||||
def variable_names(self) -> Set[str]:
|
||||
"""
|
||||
Returns
|
||||
-------
|
||||
Set[str]
|
||||
Names of all the variables within the Script.
|
||||
"""
|
||||
return set(list(self._variables.keys()))
|
||||
|
|
|
|||
|
|
@ -105,7 +105,9 @@ class FutureResolvable(AnyArgument, ABC):
|
|||
|
||||
@abstractmethod
|
||||
def future_resolvable_type(self) -> Type[Resolvable]:
|
||||
pass
|
||||
"""
|
||||
The resolvable type that this type is known to turn into
|
||||
"""
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
|
@ -197,7 +199,11 @@ class FunctionType(NamedArgument, ABC):
|
|||
class BuiltInFunctionType(FunctionType, ABC):
|
||||
@abstractmethod
|
||||
def output_type(self) -> Type[Resolvable]:
|
||||
pass
|
||||
"""
|
||||
Returns
|
||||
-------
|
||||
The known Resolvable type that a BuiltInFunction will output
|
||||
"""
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
|
@ -210,6 +216,11 @@ class Lambda(Resolvable):
|
|||
|
||||
@classmethod
|
||||
def num_input_args(cls) -> int:
|
||||
"""
|
||||
Returns
|
||||
-------
|
||||
The number of input args the Lambda function takes
|
||||
"""
|
||||
return 1
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,11 +3,9 @@
|
|||
if [[ $1 = "check" ]]; then
|
||||
isort . --check-only --diff \
|
||||
&& black . --check \
|
||||
&& pylint src/ \
|
||||
&& pydocstyle src/*
|
||||
&& pylint src/
|
||||
else
|
||||
isort .
|
||||
black .
|
||||
pylint src/
|
||||
pydocstyle src/*
|
||||
fi
|
||||
Loading…
Reference in a new issue