Skip to content

Conversation

@SourceryAI
Copy link

Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨

Here's your pull request refactoring your most popular Python repo.

If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch https://github.com/sourcery-ai-bot/obsidian-html master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Comment on lines -24 to +25
paths = {}
this_file_path = os.path.realpath(__file__) # (..)/obsidian-html/ci/tests/__filename__
paths['ci_tests'] = Path(this_file_path).parent # (..)/obsidian-html/ci/tests/
paths = {'ci_tests': Path(this_file_path).parent}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_paths refactored with the following changes:

This removes the following comments ( why? ):

# (..)/obsidian-html/ci/tests/

Comment on lines -73 to +72
if output_dict:
return {'soup': soup, 'url': url}
else:
return soup
return {'soup': soup, 'url': url} if output_dict else soup
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function html_get refactored with the following changes:

Comment on lines -93 to +89
# Merge the two
config = MergeDictRecurse(sys_config, default_config)

return config
return MergeDictRecurse(sys_config, default_config)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_default_config refactored with the following changes:

This removes the following comments ( why? ):

# Merge the two

Comment on lines -277 to +270

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TestDefaultMode.test_C_rss refactored with the following changes:

Comment on lines -456 to +465
for i, v in enumerate(sys.argv):
if v == '-r':
run_setup = True
for v in sys.argv:
if v == '-c':
run_cleanup = True
if v == 'v':
elif v == '-r':
run_setup = True
elif v == 'v':
verbose = True

# get paths
paths = get_paths()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 456-466 refactored with the following changes:

Comment on lines -353 to +338
header = soup.body.find('h'+str(header_level))
header = soup.body.find(f'h{str(header_level)}')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function selector_first_header refactored with the following changes:

Comment on lines -367 to +355
for i in range(arg[1]):
for _ in range(arg[1]):
el = el.parent
value += el.name

# Get filename minus suffix

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function selector_path refactored with the following changes:

This removes the following comments ( why? ):

# Get filename minus suffix

md.dst_path = md.dst_path.parent.joinpath('index__2.md')
md.rel_dst_path = md.dst_path.relative_to(md.dst_folder_path)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ConvertMarkdownPageToHtmlPage refactored with the following changes:

Comment on lines -38 to +41
header = ''
if len(parts) > 1:
header = parts[1]

header = parts[1] if len(parts) > 1 else ''
if filename[-3:] != '.md':
filename += '.md'

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function GetObsidianFilePath refactored with the following changes:

Comment on lines -218 to +217

# other cases -> copy over
if isinstance(update_dict[k], list):
base_dict[k] = v.copy()
else:
base_dict[k] = v

# other cases -> copy over
base_dict[k] = v.copy() if isinstance(update_dict[k], list) else v
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function MergeDictRecurse refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant