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

Address LGTM alerts #657

Merged
merged 5 commits into from
Jun 8, 2021
Merged

Address LGTM alerts #657

merged 5 commits into from
Jun 8, 2021

Conversation

jwodder
Copy link
Member

@jwodder jwodder commented Jun 7, 2021

Some alerts are false positives and thus are not addressed by this PR.

@jwodder jwodder added the internal Changes only affect the internal API label Jun 7, 2021
@codecov
Copy link

codecov bot commented Jun 7, 2021

Codecov Report

Merging #657 (da1073f) into master (97065f3) will increase coverage by 0.03%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #657      +/-   ##
==========================================
+ Coverage   83.62%   83.65%   +0.03%     
==========================================
  Files          59       59              
  Lines        5348     5352       +4     
==========================================
+ Hits         4472     4477       +5     
+ Misses        876      875       -1     
Flag Coverage Δ
unittests 83.65% <80.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
dandi/__init__.py 70.00% <ø> (ø)
dandi/metadata.py 68.31% <ø> (+0.33%) ⬆️
dandi/support/generatorify.py 0.00% <0.00%> (ø)
dandi/cli/__init__.py 80.00% <100.00%> (ø)
dandi/conftest.py 100.00% <100.00%> (ø)
dandi/support/iterators.py 100.00% <100.00%> (ø)
dandi/pynwb_utils.py 82.45% <0.00%> (+0.10%) ⬆️
dandi/utils.py 80.64% <0.00%> (+0.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8aa9f7f...da1073f. Read the comment docs.

@lgtm-com
Copy link

lgtm-com bot commented Jun 7, 2021

This pull request fixes 7 alerts when merging 2d09ba7 into 8aa9f7f - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable
  • 2 for Unused import
  • 1 for Module is imported more than once
  • 1 for Except block handles 'BaseException'
  • 1 for Suspicious unused loop iteration variable

@@ -504,7 +504,7 @@ def get_versions():
# versionfile_source is the relative path from the top of the source
# tree (where the .git directory might live) to this file. Invert
# this to find the root from __file__.
for i in cfg.versionfile_source.split('/'):
for _ in cfg.versionfile_source.split('/'):
Copy link
Member

Choose a reason for hiding this comment

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

this is versioneer one, can we just skip it for LGTM?

meanwhile checked -- current master in versioneer already has this:

$> git grep -A1 'in cfg.versionfile_source.split'
src/git/long_get_versions.py:        for _ in cfg.versionfile_source.split('/'):
src/git/long_get_versions.py-            root = os.path.dirname(root)

so in principle we could just proceed, but still I think we should just skip this file

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know how ignoring alerts works in LGTM, so I can't answer that.

Copy link
Member

Choose a reason for hiding this comment

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


from dandi.dandiapi import DandiAPIClient
from dandi.dandiset import APIDandiset
from dandi.girder import GirderCli
Copy link
Member

Choose a reason for hiding this comment

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

let's kill this file altogether -- girder is gone gone

Copy link
Member Author

Choose a reason for hiding this comment

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

Should tools/instantiate-dandisets.py (which also uses Girder) be deleted as well?

Copy link
Member

Choose a reason for hiding this comment

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

sure, why to drag it now

@lgtm-com
Copy link

lgtm-com bot commented Jun 7, 2021

This pull request fixes 7 alerts when merging ed93dad into 0fa24ee - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable
  • 2 for Unused import
  • 1 for Module is imported more than once
  • 1 for Except block handles 'BaseException'
  • 1 for Suspicious unused loop iteration variable

@lgtm-com
Copy link

lgtm-com bot commented Jun 8, 2021

This pull request fixes 7 alerts when merging b5aa3db into 0fa24ee - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable
  • 2 for Unused import
  • 1 for Module is imported more than once
  • 1 for Except block handles 'BaseException'
  • 1 for Suspicious unused loop iteration variable

dandi/due.py Outdated
@@ -55,7 +55,7 @@ def _donothing_func(*args, **kwargs):


try:
from duecredit import due, BibTeX, Doi, Url, Text
from duecredit import due, Doi # lgtm [py/unused-import]
Copy link
Member

Choose a reason for hiding this comment

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

Let's skip this file as well from lgtm checks - it is a stub which comes from duecredit and better be left unmodified

Copy link
Member

Choose a reason for hiding this comment

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

BTW, please submit a PR to duecredit for due.py so anyone who copies it also would get those pragma annotations

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you want me to revert the changes to our local due.py?

Copy link
Member

Choose a reason for hiding this comment

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

yes, to due.py and _version.py and list them to be excluded in to be added lgtm.yml per https://lgtm.com/help/lgtm/customizing-file-classification

Copy link
Member

Choose a reason for hiding this comment

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

oh I see you added already lgtm.yml -- great

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@lgtm-com
Copy link

lgtm-com bot commented Jun 8, 2021

This pull request fixes 7 alerts when merging 7efcb32 into 0fa24ee - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable
  • 2 for Unused import
  • 1 for Module is imported more than once
  • 1 for Except block handles 'BaseException'
  • 1 for Suspicious unused loop iteration variable

@lgtm-com
Copy link

lgtm-com bot commented Jun 8, 2021

This pull request fixes 6 alerts when merging da1073f into 0fa24ee - view on LGTM.com

fixed alerts:

  • 2 for Unused local variable
  • 2 for Unused import
  • 1 for Module is imported more than once
  • 1 for Except block handles 'BaseException'

@yarikoptic
Copy link
Member

Thank you @jwodder ! Let's proceed.

I feel we might like to pacify this LGTM bot to not add comments -- adding to the checks list is IMHO sufficient.

@yarikoptic yarikoptic merged commit ad838f2 into master Jun 8, 2021
@yarikoptic yarikoptic deleted the fix-lgtm branch June 8, 2021 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Changes only affect the internal API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants