Skip to content

Commit

Permalink
Fix/ignore linting errors with newer pylint. (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein authored Feb 3, 2023
1 parent ff72d91 commit 090fb92
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
8 changes: 0 additions & 8 deletions .pylintrc.automated
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,3 @@ known-third-party=enchant

# Couples of modules and preferred modules, separated by a comma.
preferred-modules=


[EXCEPTIONS]

# Exceptions that will emit a warning when being caught. Defaults to
# "BaseException, Exception".
overgeneral-exceptions=BaseException,
Exception
7 changes: 4 additions & 3 deletions src/antsibull_changelog/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ def _get_refresh_config(args: Any,
elif part == 'fragments-without-archives':
refresh_fragments = 'without-archives'
else:
# pylint:disable-next=broad-exception-raised
raise Exception(
'The config value always_refresh contains an invalid value "{0}"'.format(
part))
Expand Down Expand Up @@ -408,7 +409,7 @@ def _do_refresh(args: Any, # pylint: disable=too-many-arguments
version=changes.latest_version,
force_reload=args.reload_plugins,
use_ansible_doc=args.use_ansible_doc)
allow_removals = (refresh_plugins == 'allow-removal')
allow_removals = refresh_plugins == 'allow-removal'

changes.update_plugins(plugins, allow_removals=allow_removals)
changes.update_objects(plugins, allow_removals=allow_removals)
Expand All @@ -417,8 +418,8 @@ def _do_refresh(args: Any, # pylint: disable=too-many-arguments
if fragments is None:
fragments = load_fragments(paths, config)
archive_path_template = config.archive_path_template
has_archives = (archive_path_template is not None)
with_archives = (refresh_fragments == 'with-archives')
has_archives = archive_path_template is not None
with_archives = refresh_fragments == 'with-archives'

if config.keep_fragments or (has_archives and with_archives):
all_fragments = list(fragments)
Expand Down
3 changes: 2 additions & 1 deletion src/antsibull_changelog/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def _load_galaxy_yaml(self, needed_var: str,
if self.galaxy_yaml_loaded:
return
if not self.paths.is_collection:
# pylint:disable-next=broad-exception-raised
raise Exception('Internal error: cannot get collection details for non-collection')

if what_for is None:
Expand Down Expand Up @@ -419,7 +420,7 @@ def store(self) -> None: # noqa: C901
})
if self.title is not None:
config['title'] = self.title
should_always_refresh = (self.changes_format == 'classic')
should_always_refresh = self.changes_format == 'classic'
if self.always_refresh != ('full' if should_always_refresh else 'none'):
config['always_refresh'] = self.always_refresh
if self.keep_fragments != self.prevent_known_fragments:
Expand Down
1 change: 1 addition & 0 deletions src/antsibull_changelog/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ def _get_ansible_core_version(paths: PathsConfig) -> packaging.version.Version:
match = re.match(regex, output)
if match:
return packaging.version.Version(match.group(1))
# pylint:disable-next=broad-exception-raised
raise Exception(
f'Cannot extract ansible-core version from ansible-doc --version output:\n{output}')

Expand Down

0 comments on commit 090fb92

Please sign in to comment.