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

Fix/shadowing var #281

Merged
merged 2 commits into from
Oct 18, 2023
Merged

Fix/shadowing var #281

merged 2 commits into from
Oct 18, 2023

Conversation

niyarin
Copy link
Contributor

@niyarin niyarin commented Jul 6, 2023

This PR fix shadowing variables.
I've fixed what's in the comment (#279 (review) ) here in this PR.

  • Variable meta-info of cljam.io.bcf.reader seemed difficult, so I removed it from the check target.
  • Variable version of cljam.io.bcf.reader could be renamed, but it is also excluded from inspection because the code becomes complicated.

@codecov
Copy link

codecov bot commented Jul 6, 2023

Codecov Report

Merging #281 (d462897) into master (669258a) will increase coverage by 0.00%.
The diff coverage is 82.90%.

@@           Coverage Diff           @@
##           master     #281   +/-   ##
=======================================
  Coverage   88.86%   88.86%           
=======================================
  Files          79       79           
  Lines        6771     6772    +1     
  Branches      475      475           
=======================================
+ Hits         6017     6018    +1     
  Misses        279      279           
  Partials      475      475           
Files Coverage Δ
src/cljam/algo/convert.clj 90.00% <100.00%> (ø)
src/cljam/algo/dedupe.clj 96.72% <100.00%> (ø)
src/cljam/algo/pileup.clj 96.63% <100.00%> (ø)
src/cljam/io/bam/decoder.clj 93.06% <100.00%> (ø)
src/cljam/io/bam/reader.clj 92.59% <100.00%> (ø)
src/cljam/io/bcf/reader.clj 90.40% <100.00%> (ø)
src/cljam/io/bcf/writer.clj 90.00% <100.00%> (ø)
src/cljam/io/bed.clj 90.69% <100.00%> (ø)
src/cljam/io/dict/writer.clj 85.96% <100.00%> (ø)
src/cljam/io/fasta/core.clj 95.65% <100.00%> (-0.13%) ⬇️
... and 30 more

@niyarin niyarin marked this pull request as ready for review July 6, 2023 06:58
@niyarin niyarin requested review from alumi and a team as code owners July 6, 2023 06:58
@niyarin niyarin requested review from xckitahara and removed request for a team July 6, 2023 06:58
Copy link
Contributor

@xckitahara xckitahara left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Member

@alumi alumi left a comment

Choose a reason for hiding this comment

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

Thank you for working on this, @niyarin! 👍
The changes look good for src, but clj-kondo reports several shadowed vars in test directory. Would you fix the local binding names in tests, too?

src/cljam/algo/convert.clj Outdated Show resolved Hide resolved
Copy link
Member

@alumi alumi left a comment

Choose a reason for hiding this comment

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

Would you consider whether there are any other files where we can avoid using the :exclude directive by simply changing variable names? 🙏
I have left comments on some files, so please use them as a reference for your revision strategy.

src/cljam/algo/dedupe.clj Outdated Show resolved Hide resolved
src/cljam/algo/pileup.clj Outdated Show resolved Hide resolved
src/cljam/io/bam/decoder.clj Outdated Show resolved Hide resolved
src/cljam/io/bam/writer.clj Outdated Show resolved Hide resolved
src/cljam/io/bam_index/writer.clj Outdated Show resolved Hide resolved
src/cljam/io/bcf/reader.clj Outdated Show resolved Hide resolved
@niyarin niyarin force-pushed the fix/shadowing-var branch 2 times, most recently from 19b0d9a to 41f4fd1 Compare July 31, 2023 02:13
@alumi alumi self-requested a review July 31, 2023 02:23
Copy link
Member

@alumi alumi left a comment

Choose a reason for hiding this comment

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

@niyarin Thank you for addressing the previous points!
I apologize for the request again, but could you please consider if it's possible to further change the names of local bindings to minimize the use of :exclude directives?
I've added comments on three points as examples.
Please take a look at other codes based on the comments' guidance.
I want to emphasize again that :exclude can be used in situations like when it's crucial for the names to match exactly as specified in the documentation.

src/cljam/io/bam/writer.clj Outdated Show resolved Hide resolved
src/cljam/io/bed.clj Outdated Show resolved Hide resolved
src/cljam/io/fasta/core.clj Outdated Show resolved Hide resolved
@xckitahara xckitahara removed their assignment Sep 30, 2023
@niyarin niyarin force-pushed the fix/shadowing-var branch 2 times, most recently from a5e6da6 to 4186808 Compare October 17, 2023 07:47
@niyarin
Copy link
Contributor Author

niyarin commented Oct 17, 2023

I fixed shadowing-var in vcf-validator that recently entered master.

@niyarin niyarin requested a review from alumi October 17, 2023 07:54
Copy link
Member

@alumi alumi left a comment

Choose a reason for hiding this comment

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

Thank you, @niyarin! LGTM 👍
Would you squash your commits before merging?

@alumi alumi merged commit d3fb1f2 into master Oct 18, 2023
17 checks passed
@alumi alumi deleted the fix/shadowing-var branch October 18, 2023 04:20
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.

3 participants