Fix: Linting
This commit is contained in:
parent
76925684c7
commit
0a7d0b0cf3
0
albero/app.py
Executable file → Normal file
0
albero/app.py
Executable file → Normal file
@ -1,30 +1,30 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from albero.utils import render_template
|
from albero.utils import render_template
|
||||||
from albero.plugin.common import PluginEngineClass, PluginFileGlob, Candidate
|
from albero.plugin.common import PluginEngineClass, PluginFileGlob #, Candidate
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import anyconfig
|
import anyconfig
|
||||||
import textwrap
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class FileCandidate(Candidate):
|
#class FileCandidate(Candidate):
|
||||||
path = None
|
# path = None
|
||||||
|
#
|
||||||
def _report_data(self):
|
# def _report_data(self):
|
||||||
data = {
|
# data = {
|
||||||
# "rule": self.config,
|
# # "rule": self.config,
|
||||||
"value": self.engine._plugin_value,
|
# "value": self.engine._plugin_value,
|
||||||
"data": self.data,
|
# "data": self.data,
|
||||||
"path": str(self.path.relative_to(Path.cwd())),
|
# "path": str(self.path.relative_to(Path.cwd())),
|
||||||
}
|
# }
|
||||||
data = dict(self.config)
|
# data = dict(self.config)
|
||||||
return super()._report_data(data)
|
# return super()._report_data(data)
|
||||||
|
|
||||||
|
|
||||||
class Plugin(PluginEngineClass, PluginFileGlob):
|
class Plugin(PluginEngineClass, PluginFileGlob):
|
||||||
|
"""Generic Plugin Class"""
|
||||||
|
|
||||||
_plugin_name = "jerakia"
|
_plugin_name = "jerakia"
|
||||||
|
|
||||||
@ -69,25 +69,25 @@ class Plugin(PluginEngineClass, PluginFileGlob):
|
|||||||
|
|
||||||
# Manage var substr
|
# Manage var substr
|
||||||
ret = []
|
ret = []
|
||||||
for p in paths:
|
for path in paths:
|
||||||
p = render_template(p, scope)
|
path = render_template(path, scope)
|
||||||
ret.append(p)
|
ret.append(path)
|
||||||
|
|
||||||
log.debug(f"Render pattern: {ret}")
|
log.debug("Render pattern: %s", ret)
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def _show_paths(self, scope):
|
def _show_paths(self, scope):
|
||||||
|
|
||||||
parsed = self._preprocess(scope)
|
parsed = self._preprocess(scope)
|
||||||
log.debug(f"Expanded paths to: {parsed}")
|
log.debug("Expanded paths to: %s", parsed)
|
||||||
|
|
||||||
# Look for files (NOT BE HERE !!!)
|
# Look for files (NOT BE HERE !!!)
|
||||||
ret3 = []
|
ret3 = []
|
||||||
for p in parsed:
|
for p in parsed:
|
||||||
globbed = self._glob(p)
|
globbed = self._glob(p)
|
||||||
ret3.extend(globbed)
|
ret3.extend(globbed)
|
||||||
log.debug(f"Matched globs: {ret3}")
|
log.debug(f"Matched globs: %s", ret3)
|
||||||
|
|
||||||
return ret3
|
return ret3
|
||||||
|
|
||||||
|
|||||||
0
albero/query.py
Executable file → Normal file
0
albero/query.py
Executable file → Normal file
Loading…
x
Reference in New Issue
Block a user