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

Remove duplicate code #2053

Merged
merged 3 commits into from
Nov 25, 2022
Merged

Remove duplicate code #2053

merged 3 commits into from
Nov 25, 2022

Conversation

awgymer
Copy link
Contributor

@awgymer awgymer commented Nov 24, 2022

There was duplicated functionality being used which has been superseded by the generalised ModulesJson.get_all_components

PR checklist

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated

@awgymer awgymer marked this pull request as ready for review November 24, 2022 15:19
Copy link
Member

@mirpedrol mirpedrol left a comment

Choose a reason for hiding this comment

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

Thanks!

Comment on lines 83 to 88
if self.component_type == "modules":
installed_components = modules_json.get_all_modules().get(self.modules_repo.remote_url)
installed_components = modules_json.get_all_components(self.component_type).get(
self.modules_repo.remote_url
)
elif self.component_type == "subworkflows":
modules_json.get_installed_subworkflows().get(self.modules_repo.remote_url)
modules_json.get_all_components(self.component_type).get(self.modules_repo.remote_url)
Copy link
Member

Choose a reason for hiding this comment

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

We can delete the if/else now and only use line 84

installed_components = modules_json.get_all_components(self.component_type).get(
                    self.modules_repo.remote_url
                )

@codecov
Copy link

codecov bot commented Nov 25, 2022

Codecov Report

Merging #2053 (d78abd9) into dev (1a68dfb) will increase coverage by 0.03%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##              dev    #2053      +/-   ##
==========================================
+ Coverage   67.63%   67.66%   +0.03%     
==========================================
  Files          43       43              
  Lines        5558     5555       -3     
==========================================
  Hits         3759     3759              
+ Misses       1799     1796       -3     
Impacted Files Coverage Δ
nf_core/components/components_test.py 58.22% <0.00%> (+2.13%) ⬆️
nf_core/modules/lint/__init__.py 83.42% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@awgymer awgymer merged commit 4bf70e1 into nf-core:dev Nov 25, 2022
@awgymer awgymer deleted the remove-duplicate-code branch November 25, 2022 11:27
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.

2 participants