-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to GitHub API limits, only the first 60 comments can be shown.
|
||
import os | ||
import sys | ||
from mod import fips | ||
fips_path = os.path.dirname(os.path.abspath(__file__)) | ||
proj_path = fips_path | ||
fips.run(fips_path, proj_path, sys.argv) | ||
fips.run(proj_path, proj_path, sys.argv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 8-8
refactored with the following changes:
- Use previously assigned local variable (
use-assigned-variable
)
winterm = None | ||
if windll is not None: | ||
winterm = WinTerm() | ||
winterm = WinTerm() if windll is not None else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 10-12
refactored with the following changes:
- Move setting of default value for variable into
else
branch (introduce-default-else
) - Replace if statement with if expression (
assign-if-exp
)
if params == () or params == None: | ||
num_rows = 1 | ||
else: | ||
num_rows = params[0] | ||
num_rows = 1 if params == () or params is None else params[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function AnsiToWin32.call_win32
refactored with the following changes:
- Replace if statement with if expression (
assign-if-exp
) - Use x is None rather than x == None (
none-compare
)
handle = win32.STDOUT | ||
if on_stderr: | ||
handle = win32.STDERR | ||
handle = win32.STDERR if on_stderr else win32.STDOUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function WinTerm.set_console
refactored with the following changes:
- Move setting of default value for variable into
else
branch (introduce-default-else
) - Replace if statement with if expression (
assign-if-exp
)
handle = win32.STDOUT | ||
if on_stderr: | ||
handle = win32.STDERR | ||
handle = win32.STDERR if on_stderr else win32.STDOUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function WinTerm.set_cursor_position
refactored with the following changes:
- Move setting of default value for variable into
else
branch (introduce-default-else
) - Replace if statement with if expression (
assign-if-exp
)
def uncompress(fips_dir, path) : | ||
def uncompress(fips_dir, path): | ||
# the python zip module doesn't preserve the executable flags, so just | ||
# call unzip on Linux and OSX | ||
if util.get_host_platform() in ['osx', 'linux']: | ||
subprocess.call('unzip {}'.format(path), cwd=get_sdk_dir(fips_dir), shell=True) | ||
subprocess.call(f'unzip {path}', cwd=get_sdk_dir(fips_dir), shell=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function uncompress
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
def compute_sha256(path, converter=lambda x: x, chunk_size=65536) : | ||
def compute_sha256(path, converter=lambda x: x, chunk_size=65536): | ||
if not os.path.isfile(path) : | ||
return None | ||
result = hashlib.sha256() | ||
with open(path, 'rb') as file : | ||
chunk = file.read(chunk_size) | ||
while chunk : | ||
with open(path, 'rb') as file: | ||
while chunk := file.read(chunk_size): | ||
result.update(converter(chunk)) | ||
chunk = file.read(chunk_size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function compute_sha256
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
)
def setup(fips_dir, proj_dir) : | ||
def setup(fips_dir, proj_dir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function setup
refactored with the following changes:
- Replace call to format with f-string [×2] (
use-fstring-for-formatting
) - Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation
)
def get_toolchain(fips_dir, proj_dir, cfg) : | ||
def get_toolchain(fips_dir, proj_dir, cfg): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function get_toolchain
refactored with the following changes:
- Replace call to format with f-string [×2] (
use-fstring-for-formatting
) - Move setting of default value for variable into
else
branch (introduce-default-else
) - Use f-string instead of string concatenation [×4] (
use-fstring-for-concatenation
) - Use named expression to simplify assignment and conditional (
use-named-expression
) - Remove unnecessary else after guard condition (
remove-unnecessary-else
)
This removes the following comments ( why? ):
# look for toolchain file in current project directory
def exists(pattern, proj_dirs) : | ||
def exists(pattern, proj_dirs): | ||
"""test if at least one matching config exists | ||
|
||
:param pattern: config name pattern (e.g. 'linux-make-*') | ||
:param proj_dir: array of toplevel dirs to search (must have /configs subdir) | ||
:returns: True if at least one matching config exists | ||
""" | ||
for curDir in proj_dirs : | ||
if len(glob.glob('{}/configs/{}.yml'.format(curDir, pattern))) > 0 : | ||
return True | ||
return False | ||
return any( | ||
glob.glob(f'{curDir}/configs/{pattern}.yml') for curDir in proj_dirs | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function exists
refactored with the following changes:
- Use any() instead of for loop (
use-any
) - Simplify sequence length comparison (
simplify-len-comparison
) - Replace call to format with f-string (
use-fstring-for-formatting
)
def get_config_dirs(fips_dir, proj_dir) : | ||
def get_config_dirs(fips_dir, proj_dir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function get_config_dirs
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
) - Use f-string instead of string concatenation (
use-fstring-for-concatenation
)
def list(fips_dir, proj_dir, pattern) : | ||
def list(fips_dir, proj_dir, pattern): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function list
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
def load(fips_dir, proj_dir, pattern) : | ||
def load(fips_dir, proj_dir, pattern): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function load
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
def check_config_valid(fips_dir, proj_dir, cfg, print_errors=False) : | ||
def check_config_valid(fips_dir, proj_dir, cfg, print_errors=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function check_config_valid
refactored with the following changes:
- Replace call to format with f-string [×5] (
use-fstring-for-formatting
)
def get_imports(fips_dir, proj_dir) : | ||
def get_imports(fips_dir, proj_dir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function get_imports
refactored with the following changes:
- Replace call to format with f-string [×4] (
use-fstring-for-formatting
) - Merge dictionary assignment with declaration (
merge-dict-assign
) - Simplify logical expression using De Morgan identities [×4] (
de-morgan
)
def get_emsdk_dir(fips_dir) : | ||
def get_emsdk_dir(fips_dir): | ||
"""return the emscripten SDK path (emsdk-portable)""" | ||
return get_sdk_dir(fips_dir) + '/emsdk-portable' | ||
return f'{get_sdk_dir(fips_dir)}/emsdk-portable' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function get_emsdk_dir
refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation
)
def get_archive_path(fips_dir) : | ||
def get_archive_path(fips_dir): | ||
"""return path to sdk archive""" | ||
return get_sdk_dir(fips_dir) + '/' + get_archive_name() | ||
return f'{get_sdk_dir(fips_dir)}/{get_archive_name()}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function get_archive_path
refactored with the following changes:
- Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation
)
def uncompress(src_path, dst_path, zip_dir_name) : | ||
if '.zip' in src_path : | ||
def uncompress(src_path, dst_path, zip_dir_name): | ||
if '.zip' in src_path: | ||
with zipfile.ZipFile(src_path, 'r') as archive: | ||
archive.extractall(dst_path + '/' + zip_dir_name) | ||
elif '.tgz' or '.bz2' in path : | ||
subprocess.call('tar -xvf {}'.format(src_path), cwd=dst_path, shell=True) | ||
archive.extractall(f'{dst_path}/{zip_dir_name}') | ||
else: | ||
subprocess.call(f'tar -xvf {src_path}', cwd=dst_path, shell=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function uncompress
refactored with the following changes:
- Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation
) - Remove redundant conditional (
remove-redundant-if
) - Replace call to format with f-string (
use-fstring-for-formatting
)
def finish(sdk_dir) : | ||
def finish(sdk_dir): | ||
"""finish setting up the emscripten SDK | ||
|
||
FIXME: the used SDK version should be configurable! | ||
""" | ||
if util.get_host_platform() == 'win' : | ||
if util.get_host_platform() == 'win': | ||
# on Windows use a stable SDK version which doesn't require clang to be compiled | ||
subprocess.call(args='emsdk.bat update', cwd=sdk_dir, shell=True) | ||
subprocess.call(args='emsdk.bat install --shallow --disable-assertions {}'.format(get_sdk_version()), cwd=sdk_dir, shell=True) | ||
subprocess.call(args='emsdk.bat activate --embedded {}'.format(get_sdk_version()), cwd=sdk_dir, shell=True) | ||
else : | ||
subprocess.call( | ||
args=f'emsdk.bat install --shallow --disable-assertions {get_sdk_version()}', | ||
cwd=sdk_dir, | ||
shell=True, | ||
) | ||
subprocess.call( | ||
args=f'emsdk.bat activate --embedded {get_sdk_version()}', | ||
cwd=sdk_dir, | ||
shell=True, | ||
) | ||
else: | ||
subprocess.call(args='./emsdk update', cwd=sdk_dir, shell=True) | ||
subprocess.call(args='./emsdk install --shallow --disable-assertions {}'.format(get_sdk_version()), cwd=sdk_dir, shell=True) | ||
subprocess.call(args='./emsdk activate --embedded {}'.format(get_sdk_version()), cwd=sdk_dir, shell=True) | ||
subprocess.call( | ||
args=f'./emsdk install --shallow --disable-assertions {get_sdk_version()}', | ||
cwd=sdk_dir, | ||
shell=True, | ||
) | ||
subprocess.call( | ||
args=f'./emsdk activate --embedded {get_sdk_version()}', | ||
cwd=sdk_dir, | ||
shell=True, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function finish
refactored with the following changes:
- Replace call to format with f-string [×4] (
use-fstring-for-formatting
)
def setup(fips_dir, proj_dir) : | ||
def setup(fips_dir, proj_dir): | ||
"""setup the emscripten SDK from scratch""" | ||
log.colored(log.YELLOW, '=== setup emscripten SDK:') | ||
|
||
ensure_sdk_dirs(fips_dir) | ||
|
||
# download SDK archive | ||
if not os.path.isfile(get_archive_path(fips_dir)) : | ||
log.info("downloading '{}'...".format(get_archive_name())) | ||
if not os.path.isfile(get_archive_path(fips_dir)): | ||
log.info(f"downloading '{get_archive_name()}'...") | ||
urllib.urlretrieve(get_sdk_url(), get_archive_path(fips_dir), util.url_download_hook) | ||
else : | ||
log.info("'{}' already exists".format(get_archive_name())) | ||
else: | ||
log.info(f"'{get_archive_name()}' already exists") | ||
|
||
# uncompress SDK archive | ||
log.info("\nuncompressing '{}'...".format(get_archive_name())) | ||
log.info(f"\nuncompressing '{get_archive_name()}'...") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function setup
refactored with the following changes:
- Replace call to format with f-string [×3] (
use-fstring-for-formatting
)
def show_help(args) : | ||
def show_help(args): | ||
"""show help text""" | ||
if len(args) > 0 : | ||
if len(args) > 0: | ||
# show help for one verb | ||
verb_name = args[0] | ||
if verb_name in verb.verbs : | ||
if verb_name in verb.verbs: | ||
verb.verbs[verb_name].help() | ||
else : | ||
log.error("unknown verb '{}'".format(verb)) | ||
else : | ||
else: | ||
log.error(f"unknown verb '{verb}'") | ||
else: | ||
# show generic help | ||
log.info("fips: the high-level, multi-platform build system wrapper\n" | ||
"v{}\n" | ||
"https://www.github.com/floooh/fips\n".format(VERSION)) | ||
for proj_name in verb.proj_verbs : | ||
if proj_name != 'fips' : | ||
log.colored(log.BLUE, "=== imported from '{}':".format(proj_name)) | ||
log.info( | ||
f"fips: the high-level, multi-platform build system wrapper\nv{VERSION}\nhttps://www.github.com/floooh/fips\n" | ||
) | ||
for proj_name in verb.proj_verbs: | ||
if proj_name != 'fips': | ||
log.colored(log.BLUE, f"=== imported from '{proj_name}':") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function show_help
refactored with the following changes:
- Replace call to format with f-string [×3] (
use-fstring-for-formatting
)
def run(fips_path, proj_path, args) : | ||
def run(fips_path, proj_path, args): | ||
fips_path = util.fix_path(fips_path) | ||
proj_path = util.fix_path(proj_path) | ||
verb.import_verbs(fips_path, proj_path) | ||
if len(args) <= 1: | ||
print("run 'fips help' for more info") | ||
else : | ||
else: | ||
verb_name = args[1] | ||
verb_args = args[2:] | ||
if verb_name in ['help', '--help', '-help'] : | ||
if verb_name in ['help', '--help', '-help']: | ||
show_help(verb_args) | ||
elif verb_name == '--version' : | ||
log.info(VERSION) | ||
elif verb_name in verb.verbs : | ||
verb.verbs[verb_name].run(fips_path, proj_path, verb_args) | ||
else : | ||
log.error("unknown verb '{}'".format(verb_name)) | ||
else: | ||
log.error(f"unknown verb '{verb_name}'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function run
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
def error(msg, fatal=True) : | ||
def error(msg, fatal=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function error
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
def warn(msg) : | ||
def warn(msg): | ||
"""print a warning message""" | ||
print('{}[WARNING]{} {}'.format(YELLOW, DEF, msg)) | ||
print(f'{YELLOW}[WARNING]{DEF} {msg}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function warn
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
def ok(item, status) : | ||
def ok(item, status): | ||
"""print a green 'ok' message | ||
|
||
:param item: first part of message | ||
:param status: status (colored green) | ||
""" | ||
print('{}:\t{}{}{}'.format(item, GREEN, status, DEF)) | ||
print(f'{item}:\t{GREEN}{status}{DEF}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function ok
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
def make_clean(fips_dir, proj_dir, cfg_name) : | ||
def make_clean(fips_dir, proj_dir, cfg_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function make_clean
refactored with the following changes:
- Replace call to format with f-string [×6] (
use-fstring-for-formatting
)
def build(fips_dir, proj_dir, cfg_name, target=None) : | ||
def build(fips_dir, proj_dir, cfg_name, target=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function build
refactored with the following changes:
- Replace call to format with f-string [×7] (
use-fstring-for-formatting
)
def run(fips_dir, proj_dir, cfg_name, target_name, target_args, target_cwd) : | ||
def run(fips_dir, proj_dir, cfg_name, target_name, target_args, target_cwd): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function run
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
) - Replace call to format with f-string [×12] (
use-fstring-for-formatting
) - Use f-string instead of string concatenation (
use-fstring-for-concatenation
)
This removes the following comments ( why? ):
# load the config(s)
def clean(fips_dir, proj_dir, cfg_name) : | ||
def clean(fips_dir, proj_dir, cfg_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function clean
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
) - Replace call to format with f-string [×5] (
use-fstring-for-formatting
)
def get_target_list(fips_dir, proj_dir, cfg_name) : | ||
def get_target_list(fips_dir, proj_dir, cfg_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function get_target_list
refactored with the following changes:
- Use named expression to simplify assignment and conditional (
use-named-expression
) - Replace call to format with f-string (
use-fstring-for-formatting
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Type: Refactoring
Summary of PR: This PR includes a series of refactoring changes made by the Sourcery tool, which aim to simplify and modernize the Python codebase. The changes include the use of f-strings for string formatting, the introduction of the walrus operator for assignment expressions, and the removal of unnecessary else clauses and loops.
General PR suggestions
- Review the use of the walrus operator to ensure it does not reduce readability, especially in complex expressions.
- Verify that the removal of loops and else clauses does not omit necessary steps in the logic, particularly where generators and state finalization are involved.
- Confirm that the refactoring changes align with the minimum Python version requirement for the project, as some changes utilize Python 3.8+ features.
- Check for consistency in the codebase regarding the use of new syntax features introduced by the refactoring.
- Consider breaking up very long f-string lines into multiple lines to maintain readability.
- Ensure that variable declarations are placed appropriately to avoid potential
UnboundLocalError
issues when variables are referenced later in the code.
Your trial expires on December 18, 2023. Please email [email protected] to continue using Sourcery ✨
|
||
if imports: | ||
if type(imports) is list: | ||
log.warn(f"imports in '{proj_dir}/fips.yml' uses obsolete array format") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (llm): Consider using a more descriptive variable name for the formatted string to improve readability.
log.warn(f"imports in '{proj_dir}/fips.yml' uses obsolete array format") | |
obsolete_format_warning = f"imports in '{proj_dir}/fips.yml' uses obsolete array format" | |
+ log.warn(obsolete_format_warning) |
@@ -64,18 +65,18 @@ def get_exports(proj_dir) : | |||
dic = util.load_fips_yml(proj_dir) | |||
if 'exports' in dic : | |||
exports = dic['exports'] | |||
if not 'header-dirs' in exports : | |||
if 'header-dirs' not in exports: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought (llm): The refactoring to use 'not in' is more Pythonic and improves readability.
unique_modules = {} | ||
|
||
if success : | ||
if success: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (llm): The repositioning of the variable declarations inside the 'if success:' block may lead to 'unique_defines' and 'unique_modules' being undefined if 'success' is False. Ensure that these variables are defined outside the conditional block if they are used later in the code.
proj = glob.glob(build_dir + '/*.xcodeproj') | ||
if proj : | ||
subprocess.call('open "{}"'.format(proj[0]), shell=True) | ||
if proj := glob.glob(f'{build_dir}/*.xcodeproj'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (llm): Using the walrus operator (:=) for assignment expressions is a nice touch, but it's only available in Python 3.8 and later. Ensure that the minimum Python version requirement for this project is clearly documented or consider backward compatibility.
git_url = util.get_giturl_from_url(url) | ||
git_branch = util.get_gitbranch_from_url(url) | ||
if git.clone(git_url, git_branch, git.clone_depth, proj_name, ws_dir) : | ||
if git.clone(git_url, git_branch, git.clone_depth, proj_name, ws_dir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (llm): Ensure that 'git.clone_depth' is a valid attribute and is intended to be used as a default depth for cloning. If it's a constant, it might be better to use uppercase naming convention.
@@ -99,63 +97,61 @@ def list_exports(fips_dir, proj_dir) : | |||
if not (cur_modules or cur_hdrs or cur_libs or cur_defs) : | |||
log.info(" nothing") | |||
|
|||
if cur_modules : | |||
if cur_modules: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (llm): Using the walrus operator (:=) for assignment expressions is a nice use of Python 3.8+ features, but ensure that the codebase is consistent with its usage and that it doesn't reduce readability for complex expressions.
output = subprocess.check_output('git status --porcelain', | ||
cwd=proj_dir, shell=True).decode("utf-8") | ||
if output: | ||
if output := subprocess.check_output( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (llm): While the use of the walrus operator is concise, be cautious with its use in complex expressions as it may impact readability, especially for developers not familiar with this newer syntax.
@@ -91,10 +86,7 @@ def construct_object(self, node, deep=False): | |||
if isinstance(data, types.GeneratorType): | |||
generator = data | |||
data = generator.next() | |||
if self.deep_construct: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (llm): Ensure that the removal of the loop over the generator does not skip any necessary steps that might be required for the construction process when 'deep_construct' is True.
if proj_name != 'fips' : | ||
log.colored(log.BLUE, "=== imported from '{}':".format(proj_name)) | ||
log.info( | ||
f"fips: the high-level, multi-platform build system wrapper\nv{VERSION}\nhttps://www.github.com/floooh/fips\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (llm): While the use of f-strings is encouraged, be cautious with very long lines as they may impact readability. Consider breaking the string into multiple lines if it enhances clarity.
dep_proj_name = util.get_project_name_from_url(dep_url) | ||
new_imports[dep_proj_name] = {} | ||
new_imports[dep_proj_name]['git'] = util.get_giturl_from_url(dep_url) | ||
new_imports[dep_proj_name] = {'git': util.get_giturl_from_url(dep_url)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise (llm): Good job on simplifying the dictionary assignment by using a dictionary literal.
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:Help us improve this pull request!