Skip to content
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

Sourcery refactored master branch #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Nov 15, 2022

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

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

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from nanpuhaha November 15, 2022 00:20
Comment on lines -48 to +50
if new_param is None:
# if we still cannot find any new parameters, break
break
if new_param is None:
# if we still cannot find any new parameters, break
break
Copy link
Author

Choose a reason for hiding this comment

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

Function extract_params refactored with the following changes:

Comment on lines -199 to +204
<kbd>{name}({", ".join([param for param in funcs[name]['parameters']])})</kbd><br><br>
<kbd>{name}({", ".join(list(funcs[name]['parameters']))})</kbd><br><br>
<p>
{funcs[name]['description']}
</p>
"""

Copy link
Author

Choose a reason for hiding this comment

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

Function functions_html refactored with the following changes:

Comment on lines -266 to -270
# !!! TODO make the navbar code here
navbar = ""

# now save to templates within the docs directory
output(navbar, 'navbar.js', os.path.join(docs_dir, 'templates'))
Copy link
Author

Choose a reason for hiding this comment

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

Function build_navbar refactored with the following changes:

This removes the following comments ( why? ):

# now save to templates within the docs directory
# !!! TODO make the navbar code here

Comment on lines -319 to +317
if submodule != "":
fullpath = [module, submodule]
else:
fullpath = [module]

fullpath = [module, submodule] if submodule != "" else [module]
Copy link
Author

Choose a reason for hiding this comment

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

Function build_page refactored with the following changes:

Comment on lines -478 to +473
if not any([ext in filename for ext in file_types]):
if all(ext not in filename for ext in file_types):
Copy link
Author

Choose a reason for hiding this comment

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

Function output refactored with the following changes:

Comment on lines -517 to +510

Copy link
Author

Choose a reason for hiding this comment

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

Found the following improvement in Function bootstrap_download:

if not any([os.path.exists(loc) for loc in bootstraps]):
if not any(os.path.exists(loc) for loc in bootstraps):
# if any do not exist, we download all
print("Not all required Bootstrap files found. "
"They will be downloaded to "
f"'{os.path.join(docs_dir, 'templates')}'.")
# download bootstrap files
bootstrap_download(docs_dir)

Copy link
Author

Choose a reason for hiding this comment

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

Function DocsBuilder.__init__ refactored with the following changes:

Comment on lines -614 to +609
if new_class is None:
# if no classes anywhere, break the loop
break
if new_class is None:
# if no classes anywhere, break the loop
break
Copy link
Author

Choose a reason for hiding this comment

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

Function DocsBuilder.extract refactored with the following changes:

Comment on lines -668 to +681
# we may end up with multiple pages, so initialise Dictionary
pages = {}
# filename version of module
filename = self.module.lower().replace(" ", "_")
# build top-level page
pages[filename] = \
build_page(self.module, self.devs, self.desc, self.classes,
self.funcs)
pages = {
filename: build_page(
self.module, self.devs, self.desc, self.classes, self.funcs
)
}

# iterate through classes (if any) and build page for each
if len(self.classes) > 0:
for c in self.classes:
print(f"{filename}.{c}")
print(c)
pages[f"{filename}.{c}"] = \
build_page(self.module, self.devs,
build_page(self.module, self.devs,
self.classes[c]['description'], classes="",
funcs=self.classes[c]['funcs'], submodule=c)

# finally save all to file
for page in pages:
output(pages[page], page, path=path)
for page, value in pages.items():
output(value, page, path=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 DocsBuilder.build refactored with the following changes:

This removes the following comments ( why? ):

# we may end up with multiple pages, so initialise Dictionary
# build top-level page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
0 participants