Clean up scifolder linting
Summary
Currently the scifolder code only passes the linter with a massive amount of disable
directives. Many of these probably mean that it is very easy to cause exceptions by proper usage of the code.
Expected Behavior
pylint
should just accept the code.
Actual Behavior
src/caosadvancedtools/scifolder$ grep -rn "pylint: disable"
simulation_cfood.py:91: if SOURCES.key in self.header: # pylint: disable=unsupported-membership-test
simulation_cfood.py:96: globs=get_glob(self.header[SOURCES.key]), # pylint: disable=unsubscriptable-object
simulation_cfood.py:102: if REVISIONOF.key in self.header: # pylint: disable=unsupported-membership-test
simulation_cfood.py:105: recordtypes=[dm.Software], # pylint: disable=no-member
simulation_cfood.py:107: globs=get_glob(self.header[dm.revisionOf]), # pylint: disable=unsubscriptable-object
utils.py:115: return list(df.ID) # pylint: disable=no-member
withreadme.py:124: if self.crawled_path.lower().endswith(".md"): # pylint: disable=no-member
withreadme.py:126: fileguide.access(self.crawled_path)) # pylint: disable=no-member
withreadme.py:127: elif self.crawled_path.lower().endswith(".xlsx"): # pylint: disable=no-member
withreadme.py:129: fileguide.access(self.crawled_path)) # pylint: disable=no-member
withreadme.py:148: globs, prefix=os.path.dirname(self.crawled_path)) # pylint: disable=no-member
withreadme.py:163: self.attached_filenames.extend(flat_list) # pylint: disable=no-member
withreadme.py:188: for field in self.win_paths: # pylint: disable=no-member
withreadme.py:248: to_be_updated=self.to_be_updated, # pylint: disable=no-member
withreadme.py:258: if field.key not in self.header: # pylint: disable=no-member
withreadme.py:262: for item in self.header[field.key]: # pylint: disable=no-member
withreadme.py:267: os.path.dirname(self.crawled_path), # pylint: disable=no-member
Steps to Reproduce the Problem
Run pylint
on the code before the disable
directives were added. Or:
from caosadvancedtools.scifolder.simulation_cfood import SimulationCFood
scf = SimulationCFood(".")
scf.update_identifiables()
# raises AttributeError: 'SimulationCFood' object has no attribute 'simulation'
Specifications
- Version: Latest dev branch commit
- Platform: Debian/Linux
Possible fixes
- Maybe add more values to the
__init__()
methods?