Skip to content

Commit

Permalink
Merge pull request #159 from prjemian/lgtm-hints
Browse files Browse the repository at this point in the history
Fix some hints from LGTM
  • Loading branch information
carterbox authored Nov 13, 2021
2 parents 61b03d2 + 4d2db63 commit a5f3900
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion punx/github_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ def _get_last_modified(self):
"""get the ``last_modified`` date from the SHA's commit"""
if self.sha is not None:
commit = self.repo.get_commit(self.sha)
mod_date_time = commit.last_modified # Tue, 20 Dec 2016 18:30:29 GMT
fmt = "%a, %d %b %Y %H:%M:%S %Z" # --> 2016-11-19 01:04:28
mod_date_time = datetime.datetime.strptime(commit.last_modified, fmt)
self.last_modified = str(mod_date_time)
Expand Down
4 changes: 2 additions & 2 deletions punx/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ def get_subject(parent, o):
else:
get_subject(parent, group[item])

def validate_item_name(self, v_item, key=None):
def validate_item_name(self, v_item):
from .validations import item_name

item_name.verify(self, v_item, key)
item_name.verify(self, v_item)

def validate_attribute(self, v_item):
from .validations import attribute
Expand Down
5 changes: 1 addition & 4 deletions punx/validations/item_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ def isNeXusLinkTarget(v_item):
return False # no @target attribute at all


def verify(validator, v_item, key=None):
def verify(validator, v_item):
"""
check :class:`ValidationItem` *v_item* using *validItemName* regular expression
This is used for the names of groups, fields, links, and attributes.
:param obj v_item: instance of :class:`ValidationItem`
:param str key: named key to search, default: None (``validItemName``)
This method will test the object's name for validation,
comparing with the strict or relaxed regular expressions for
Expand All @@ -72,8 +71,6 @@ def verify(validator, v_item, key=None):
if "name" in v_item.validations:
return # do not repeat this

key = key or "validItemName"

if v_item.h5_address is not None and v_item.h5_address.endswith("@NX_class"):
handle_NX_class(validator, v_item)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------

from setuptools import setup, find_packages
from setuptools import setup
import os
import versioneer

Expand Down

0 comments on commit a5f3900

Please sign in to comment.