Skip to content

Commit

Permalink
Remove unused type ignore comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobGM committed May 3, 2018
1 parent 5cde152 commit dd095dd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
14 changes: 7 additions & 7 deletions astrality/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def execute(self) -> Dict[Path, Path]:
# and insert it into the configuration options.
template = self.option(key='content', path=True)
target = self._create_temp_file(template.name)
self._options['target'] = str(target) # type: ignore
self._options['target'] = str(target)

# These might either be file paths or directory paths
template_source = self.option(key='content', path=True)
Expand Down Expand Up @@ -276,7 +276,7 @@ def _create_temp_file(self, name) -> Path:
:return: Path object pointing to the created temporary file.
"""
temp_file = NamedTemporaryFile( # type: ignore
temp_file = NamedTemporaryFile(
prefix=name + '-',
# dir=Path(self.temp_directory),
)
Expand Down Expand Up @@ -460,7 +460,7 @@ def __init__(self, *args, **kwargs) -> None:
return

# Create equivalent compile action based on stow config
compile_options: CompileDict = { # type: ignore
compile_options: CompileDict = {
'content': self._options['content'],
'target': self._options['target'],
'include': self._options.get('templates', r'template\.(.+)'),
Expand Down Expand Up @@ -508,7 +508,7 @@ def __init__(self, *args, **kwargs) -> None:
if non_templates_action.lower() == 'copy':
NonTemplatesAction = CopyAction
else:
NonTemplatesAction = SymlinkAction # type: ignore
NonTemplatesAction = SymlinkAction

self.non_templates_action = NonTemplatesAction(
options=non_templates_options,
Expand Down Expand Up @@ -756,13 +756,13 @@ def __init__(

for identifier, action_type in self.action_types.items():
# Create and persist a list of all ImportContextAction objects
action_configs = utils.cast_to_list( # type: ignore
self.action_block.get(identifier, {}), # type: ignore
action_configs = utils.cast_to_list(
self.action_block.get(identifier, {}),
)
setattr(
self,
f'_{identifier}_actions',
[action_type( # type: ignore
[action_type(
options=action_config,
directory=directory,
replacer=replacer,
Expand Down
10 changes: 5 additions & 5 deletions astrality/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def user_configuration(
global_context = Context()

# Global configuration options
config = dict_from_config_file( # type: ignore
config = dict_from_config_file(
config_file=config_file,
context=global_context,
prepend='config/',
Expand All @@ -176,7 +176,7 @@ def user_configuration(
# Globally defined modules
modules_file = config_directory / 'modules.yml'
if modules_file.exists():
modules_config = dict_from_config_file( # type: ignore
modules_config = dict_from_config_file(
config_file=modules_file,
context=global_context,
prepend='module/',
Expand Down Expand Up @@ -399,7 +399,7 @@ def type(cls, of: str) -> 'ModuleSource':
class GlobalModuleSource(ModuleSource):
"""Module defined in `$ASTRALITY_CONFIG_HOME/modules.yml`."""

name_syntax = re.compile(r'^(\w+|\*)$') # type: ignore
name_syntax = re.compile(r'^(\w+|\*)$')
prepend = ''

def __init__(
Expand Down Expand Up @@ -431,7 +431,7 @@ def __repr__(self) -> str:
class GithubModuleSource(ModuleSource):
"""Module defined in a GitHub repository."""

name_syntax = re.compile(r'^github::.+/.+(::(\w+|\*))?$') # type: ignore
name_syntax = re.compile(r'^github::.+/.+(::(\w+|\*))?$')
_config: ApplicationConfig

def __init__(
Expand Down Expand Up @@ -510,7 +510,7 @@ class DirectoryModuleSource(ModuleSource):
Specifically: `$ASTRALITY_CONFIG_HOME/{modules_directory}/config.yml
"""

name_syntax = re.compile(r'^(?!github::).+::(\w+|\*)$') # type: ignore
name_syntax = re.compile(r'^(?!github::).+::(\w+|\*)$')

def __init__(
self,
Expand Down
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ strict_optional = True
incremental = True
ignore_missing_imports = True
warn_redundant_casts = True
warn_unused_ignores = True
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ livereload==2.5.1 # via sphinx-autobuild
markupsafe==1.0 # via jinja2
mccabe==0.6.1 # via flake8
mypy-extensions==0.3.0
mypy==0.590
mypy==0.600
packaging==16.8 # via sphinx
pathtools==0.1.2 # via sphinx-autobuild, watchdog
pip-tools==1.11.0
pip-tools==2.0.2
pluggy==0.6.0 # via pytest
port-for==0.3.1 # via sphinx-autobuild
py==1.5.2 # via pytest
Expand Down

0 comments on commit dd095dd

Please sign in to comment.