index int64 0 50.7k | project_path stringclasses 279
values | completion_path stringlengths 57 199 | signature_postion stringlengths 3 11 | class_position stringlengths 3 11 | function_name stringlengths 1 62 | class_name stringlengths 0 55 | body_position stringlengths 3 11 | body_position_with_comments stringlengths 3 11 | masked_class stringlengths 14 8.32k | masked_class_with_comment stringlengths 14 8.32k | func_body stringlengths 9 6.72k | func_body_with_comment stringlengths 9 6.72k | len_func_body int64 1 643 | len_input int64 10 2.02k | len_output int64 4 1.9k | total int64 20 2.05k | file_code stringlengths 14 442k | file_code_with_comment stringlengths 14 442k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
46,054 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/mulled/util.py | 419,420 | 414,435 | progress | PrintProgress | 420,426 | 420,426 | class PrintProgress:
def __init__(self) -> None:
self.thread = threading.Thread(target=self.progress)
self.stop = threading.Event()
def progress(self) -> None:
FILL_FUNC_BODY def __enter__(self) -> "PrintProgress":
self.thread.start()
return self
def __exit__(self, exc_t... | class PrintProgress:
def __init__(self) -> None:
self.thread = threading.Thread(target=self.progress)
self.stop = threading.Event()
def progress(self) -> None:
FILL_FUNC_BODY def __enter__(self) -> "PrintProgress":
self.thread.start()
return self
def __exit__(self, exc_t... | while not self.stop.is_set():
print(".", end="")
sys.stdout.flush()
self.stop.wait(60)
print("")
| while not self.stop.is_set():
print(".", end="")
sys.stdout.flush()
self.stop.wait(60)
print("")
| 8 | 136 | 53 | 189 | """Utilities for working with mulled abstractions outside the mulled package."""
import collections
import hashlib
import logging
import os
import re
import sys
import threading
from typing import (
Any,
Dict,
Iterable,
List,
NamedTuple,
Optional,
TYPE_CHECKING,
Union,
)
import request... | """Utilities for working with mulled abstractions outside the mulled package."""
import collections
import hashlib
import logging
import os
import re
import sys
import threading
from typing import (
Any,
Dict,
Iterable,
List,
NamedTuple,
Optional,
TYPE_CHECKING,
Union,
)
import request... |
46,056 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/requirements.py | 217,219 | 182,234 | from_dict | ContainerDescription | 219,230 | 219,230 | class ContainerDescription:
def __init__(
self,
identifier: str,
type: str = DEFAULT_CONTAINER_TYPE,
resolve_dependencies: bool = DEFAULT_CONTAINER_RESOLVE_DEPENDENCIES,
shell: str = DEFAULT_CONTAINER_SHELL,
) -> None:
# Force to lowercase because container image ... | class ContainerDescription:
def __init__(
self,
identifier: str,
type: str = DEFAULT_CONTAINER_TYPE,
resolve_dependencies: bool = DEFAULT_CONTAINER_RESOLVE_DEPENDENCIES,
shell: str = DEFAULT_CONTAINER_SHELL,
) -> None:
# Force to lowercase because container image ... | identifier = dict["identifier"]
type = dict.get("type", DEFAULT_CONTAINER_TYPE)
resolve_dependencies = dict.get("resolve_dependencies", DEFAULT_CONTAINER_RESOLVE_DEPENDENCIES)
shell = dict.get("shell", DEFAULT_CONTAINER_SHELL)
return cls(
identifier=identifier,
... | identifier = dict["identifier"]
type = dict.get("type", DEFAULT_CONTAINER_TYPE)
resolve_dependencies = dict.get("resolve_dependencies", DEFAULT_CONTAINER_RESOLVE_DEPENDENCIES)
shell = dict.get("shell", DEFAULT_CONTAINER_SHELL)
return cls(
identifier=identifier,
... | 22 | 434 | 133 | 567 | import copy
import os
from typing import (
Any,
Callable,
cast,
Dict,
Iterable,
Iterator,
List,
Optional,
Tuple,
Union,
)
from typing_extensions import (
get_args,
Literal,
)
from galaxy.util import (
asbool,
xml_text,
)
from galaxy.util.oset import OrderedSet
... | import copy
import os
from typing import (
Any,
Callable,
cast,
Dict,
Iterable,
Iterator,
List,
Optional,
Tuple,
Union,
)
from typing_extensions import (
get_args,
Literal,
)
from galaxy.util import (
asbool,
xml_text,
)
from galaxy.util.oset import OrderedSet
... |
46,057 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/requirements.py | 102,104 | 84,115 | from_dict | RequirementSpecification | 104,108 | 104,108 | class RequirementSpecification:
"""Refine a requirement using a URI."""
def __init__(self, uri: str, version: Optional[str] = None) -> None:
self.uri = uri
self.version = version
@property
def specifies_version(self) -> bool:
return self.version is not None
@property
d... | class RequirementSpecification:
"""Refine a requirement using a URI."""
def __init__(self, uri: str, version: Optional[str] = None) -> None:
self.uri = uri
self.version = version
@property
def specifies_version(self) -> bool:
return self.version is not None
@property
d... | uri = dict["uri"]
version = dict.get("version", None)
return cls(uri=uri, version=version)
| uri = dict["uri"]
version = dict.get("version", None)
return cls(uri=uri, version=version)
| 10 | 253 | 39 | 292 | import copy
import os
from typing import (
Any,
Callable,
cast,
Dict,
Iterable,
Iterator,
List,
Optional,
Tuple,
Union,
)
from typing_extensions import (
get_args,
Literal,
)
from galaxy.util import (
asbool,
xml_text,
)
from galaxy.util.oset import OrderedSet
... | import copy
import os
from typing import (
Any,
Callable,
cast,
Dict,
Iterable,
Iterator,
List,
Optional,
Tuple,
Union,
)
from typing_extensions import (
get_args,
Literal,
)
from galaxy.util import (
asbool,
xml_text,
)
from galaxy.util.oset import OrderedSet
... |
46,058 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/requirements.py | 268,269 | 251,278 | get_value | ResourceRequirement | 269,278 | 269,278 | class ResourceRequirement:
def __init__(self, value_or_expression: Union[int, float, str], resource_type: ResourceType) -> None:
self.value_or_expression = value_or_expression
if not resource_type:
raise ValueError("Missing resource requirement type")
if resource_type not in VALI... | class ResourceRequirement:
def __init__(self, value_or_expression: Union[int, float, str], resource_type: ResourceType) -> None:
self.value_or_expression = value_or_expression
if not resource_type:
raise ValueError("Missing resource requirement type")
if resource_type not in VALI... | if self.runtime_required:
# TODO: hook up evaluator
# return js_evaluator(self.value_or_expression, runtime)
raise NotImplementedError(
f"{self.value_or_expression} is not an integer or float value, expressions currently not implemented"
)
... | if self.runtime_required:
# TODO: hook up evaluator
# return js_evaluator(self.value_or_expression, runtime)
raise NotImplementedError(
f"{self.value_or_expression} is not an integer or float value, expressions currently not implemented"
)
... | 28 | 257 | 99 | 356 | import copy
import os
from typing import (
Any,
Callable,
cast,
Dict,
Iterable,
Iterator,
List,
Optional,
Tuple,
Union,
)
from typing_extensions import (
get_args,
Literal,
)
from galaxy.util import (
asbool,
xml_text,
)
from galaxy.util.oset import OrderedSet
... | import copy
import os
from typing import (
Any,
Callable,
cast,
Dict,
Iterable,
Iterator,
List,
Optional,
Tuple,
Union,
)
from typing_extensions import (
get_args,
Literal,
)
from galaxy.util import (
asbool,
xml_text,
)
from galaxy.util.oset import OrderedSet
... |
46,059 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/requirements.py | 59,61 | 31,84 | from_dict | ToolRequirement | 61,67 | 61,67 | class ToolRequirement:
"""
Represents an external requirement that must be available for the tool to
run (for example, a program, package, or library). Requirements can
optionally assert a specific version.
"""
def __init__(
self,
name: str,
type: Optional[str] = None,
... | class ToolRequirement:
"""
Represents an external requirement that must be available for the tool to
run (for example, a program, package, or library). Requirements can
optionally assert a specific version.
"""
def __init__(
self,
name: str,
type: Optional[str] = None,
... | version = d.get("version")
name = d["name"]
type = d.get("type")
specs = [RequirementSpecification.from_dict(s) for s in d.get("specs", [])]
return cls(name=name, type=type, version=version, specs=specs)
| version = d.get("version")
name = d["name"]
type = d.get("type")
specs = [RequirementSpecification.from_dict(s) for s in d.get("specs", [])]
return cls(name=name, type=type, version=version, specs=specs)
| 22 | 460 | 87 | 547 | import copy
import os
from typing import (
Any,
Callable,
cast,
Dict,
Iterable,
Iterator,
List,
Optional,
Tuple,
Union,
)
from typing_extensions import (
get_args,
Literal,
)
from galaxy.util import (
asbool,
xml_text,
)
from galaxy.util.oset import OrderedSet
... | import copy
import os
from typing import (
Any,
Callable,
cast,
Dict,
Iterable,
Iterator,
List,
Optional,
Tuple,
Union,
)
from typing_extensions import (
get_args,
Literal,
)
from galaxy.util import (
asbool,
xml_text,
)
from galaxy.util.oset import OrderedSet
... |
46,060 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/requirements.py | 134,136 | 115,173 | resolvable | ToolRequirements | 136,138 | 136,138 | class ToolRequirements:
"""
Represents all requirements (packages, env vars) needed to run a tool.
"""
def __init__(self, tool_requirements: Optional[List[Union[ToolRequirement, Dict[str, Any]]]] = None) -> None:
if tool_requirements:
if not isinstance(tool_requirements, list):
... | class ToolRequirements:
"""
Represents all requirements (packages, env vars) needed to run a tool.
"""
def __init__(self, tool_requirements: Optional[List[Union[ToolRequirement, Dict[str, Any]]]] = None) -> None:
if tool_requirements:
if not isinstance(tool_requirements, list):
... | return ToolRequirements([r for r in self.tool_requirements if r.type in {"package", "set_environment"}])
| return ToolRequirements([r for r in self.tool_requirements if r.type in {"package", "set_environment"}])
| 11 | 627 | 34 | 661 | import copy
import os
from typing import (
Any,
Callable,
cast,
Dict,
Iterable,
Iterator,
List,
Optional,
Tuple,
Union,
)
from typing_extensions import (
get_args,
Literal,
)
from galaxy.util import (
asbool,
xml_text,
)
from galaxy.util.oset import OrderedSet
... | import copy
import os
from typing import (
Any,
Callable,
cast,
Dict,
Iterable,
Iterator,
List,
Optional,
Tuple,
Union,
)
from typing_extensions import (
get_args,
Literal,
)
from galaxy.util import (
asbool,
xml_text,
)
from galaxy.util.oset import OrderedSet
... |
46,061 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/brewed_tool_shed_packages.py | 143,144 | 1,153 | build_recipe_name | 144,152 | 144,152 | """
This dependency resolver resolves tool shed dependencies (those defined
tool_dependencies.xml) installed using Platform Homebrew and converted
via shed2tap (e.g. https://github.com/jmchilton/homebrew-toolshed).
"""
import logging
import os
from galaxy.util import parse_xml
from . import (
DependencyResolver,
... | """
This dependency resolver resolves tool shed dependencies (those defined
tool_dependencies.xml) installed using Platform Homebrew and converted
via shed2tap (e.g. https://github.com/jmchilton/homebrew-toolshed).
"""
import logging
import os
from galaxy.util import parse_xml
from . import (
DependencyResolver,
... | # TODO: Consider baking package_name and package_version into name? (would be more "correct")
owner = repository_owner.replace("-", "")
name = repository_name
name = name.replace("_", "").replace("-", "")
base = f"{owner}_{name}"
return base
| # TODO: Consider baking package_name and package_version into name? (would be more "correct")
owner = repository_owner.replace("-", "")
name = repository_name
name = name.replace("_", "").replace("-", "")
base = f"{owner}_{name}"
return base
| 30 | 1,429 | 88 | 1,517 | """
This dependency resolver resolves tool shed dependencies (those defined
tool_dependencies.xml) installed using Platform Homebrew and converted
via shed2tap (e.g. https://github.com/jmchilton/homebrew-toolshed).
"""
import logging
import os
from galaxy.util import parse_xml
from . import (
DependencyResolver,
... | """
This dependency resolver resolves tool shed dependencies (those defined
tool_dependencies.xml) installed using Platform Homebrew and converted
via shed2tap (e.g. https://github.com/jmchilton/homebrew-toolshed).
"""
import logging
import os
from galaxy.util import parse_xml
from . import (
DependencyResolver,
... | |
46,062 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/brewed_tool_shed_packages.py | 45,46 | 24,89 | _find_tool_dependencies | HomebrewToolShedDependencyResolver | 46,58 | 46,58 | class HomebrewToolShedDependencyResolver(
DependencyResolver,
UsesHomebrewMixin,
UsesToolDependencyDirMixin,
UsesInstalledRepositoriesMixin,
):
resolver_type = "tool_shed_tap"
def __init__(self, dependency_manager, **kwds):
self._init_homebrew(**kwds)
self._init_base_path(depend... | class HomebrewToolShedDependencyResolver(
DependencyResolver,
UsesHomebrewMixin,
UsesToolDependencyDirMixin,
UsesInstalledRepositoriesMixin,
):
resolver_type = "tool_shed_tap"
def __init__(self, dependency_manager, **kwds):
self._init_homebrew(**kwds)
self._init_base_path(depend... | installed_tool_dependency = self._get_installed_dependency(name, type, version=version, **kwds)
if installed_tool_dependency:
return self._resolve_from_installed_tool_dependency(name, version, installed_tool_dependency)
if "tool_dir" in kwds:
tool_directory = os.path.abs... | installed_tool_dependency = self._get_installed_dependency(name, type, version=version, **kwds)
if installed_tool_dependency:
return self._resolve_from_installed_tool_dependency(name, version, installed_tool_dependency)
if "tool_dir" in kwds:
tool_directory = os.path.abs... | 32 | 595 | 199 | 794 | """
This dependency resolver resolves tool shed dependencies (those defined
tool_dependencies.xml) installed using Platform Homebrew and converted
via shed2tap (e.g. https://github.com/jmchilton/homebrew-toolshed).
"""
import logging
import os
from galaxy.util import parse_xml
from . import (
DependencyResolver,
... | """
This dependency resolver resolves tool shed dependencies (those defined
tool_dependencies.xml) installed using Platform Homebrew and converted
via shed2tap (e.g. https://github.com/jmchilton/homebrew-toolshed).
"""
import logging
import os
from galaxy.util import parse_xml
from . import (
DependencyResolver,
... |
46,063 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/brewed_tool_shed_packages.py | 102,103 | 89,112 | find | RawDependencies | 103,112 | 103,112 | class RawDependencies:
def __init__(self, dependencies_file):
self.root = parse_xml(dependencies_file).getroot()
dependencies = []
package_els = self.root.findall("package") or []
for package_el in package_els:
repository_el = package_el.find("repository")
if ... | class RawDependencies:
def __init__(self, dependencies_file):
self.root = parse_xml(dependencies_file).getroot()
dependencies = []
package_els = self.root.findall("package") or []
for package_el in package_els:
repository_el = package_el.find("repository")
if ... | target_dependency = None
for dependency in self.dependencies:
if dependency.package_name == package_name and dependency.package_version == package_version:
target_dependency = dependency
break
return target_dependency
| target_dependency = None
for dependency in self.dependencies:
if dependency.package_name == package_name and dependency.package_version == package_version:
target_dependency = dependency
break
return target_dependency
| 21 | 154 | 68 | 222 | """
This dependency resolver resolves tool shed dependencies (those defined
tool_dependencies.xml) installed using Platform Homebrew and converted
via shed2tap (e.g. https://github.com/jmchilton/homebrew-toolshed).
"""
import logging
import os
from galaxy.util import parse_xml
from . import (
DependencyResolver,
... | """
This dependency resolver resolves tool shed dependencies (those defined
tool_dependencies.xml) installed using Platform Homebrew and converted
via shed2tap (e.g. https://github.com/jmchilton/homebrew-toolshed).
"""
import logging
import os
from galaxy.util import parse_xml
from . import (
DependencyResolver,
... |
46,064 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/brewed_tool_shed_packages.py | 138,140 | 112,143 | package_version | RawDependency | 140,143 | 140,143 | class RawDependency:
def __init__(self, dependencies, package_el, repository_el):
self.dependencies = dependencies
self.package_el = package_el
self.repository_el = repository_el
def __repr__(self):
temp = "Dependency[package_name=%s,version=%s,dependent_package=%s]"
ret... | class RawDependency:
def __init__(self, dependencies, package_el, repository_el):
self.dependencies = dependencies
self.package_el = package_el
self.repository_el = repository_el
def __repr__(self):
temp = "Dependency[package_name=%s,version=%s,dependent_package=%s]"
ret... | return self.package_el.attrib["version"]
| return self.package_el.attrib["version"]
| 2 | 245 | 19 | 264 | """
This dependency resolver resolves tool shed dependencies (those defined
tool_dependencies.xml) installed using Platform Homebrew and converted
via shed2tap (e.g. https://github.com/jmchilton/homebrew-toolshed).
"""
import logging
import os
from galaxy.util import parse_xml
from . import (
DependencyResolver,
... | """
This dependency resolver resolves tool shed dependencies (those defined
tool_dependencies.xml) installed using Platform Homebrew and converted
via shed2tap (e.g. https://github.com/jmchilton/homebrew-toolshed).
"""
import logging
import os
from galaxy.util import parse_xml
from . import (
DependencyResolver,
... |
46,066 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/conda.py | 518,519 | 451,531 | shell_commands | CondaDependency | 519,531 | 519,531 | class CondaDependency(Dependency):
dict_collection_visible_keys = Dependency.dict_collection_visible_keys + [
"environment_path",
"name",
"version",
"dependency_resolver",
]
dependency_type = "conda"
cacheable = True
def __init__(
self,
conda_context:... | class CondaDependency(Dependency):
dict_collection_visible_keys = Dependency.dict_collection_visible_keys + [
"environment_path",
"name",
"version",
"dependency_resolver",
]
dependency_type = "conda"
cacheable = True
def __init__(
self,
conda_context:... | if not self.cache_path:
# Build an isolated environment if not using a cached dependency manager
self.build_environment()
if self._preserve_python_environment:
# On explicit testing the only such requirement I am aware of is samtools - and it seems to work
... | if not self.cache_path:
# Build an isolated environment if not using a cached dependency manager
self.build_environment()
if self._preserve_python_environment:
# On explicit testing the only such requirement I am aware of is samtools - and it seems to work
... | 66 | 630 | 166 | 796 | """
This is still an experimental module and there will almost certainly be backward
incompatible changes coming.
"""
import logging
import os
import re
from typing import (
List,
Optional,
)
import galaxy.tool_util.deps.installable
from galaxy.tool_util.deps.requirements import (
ToolRequirement,
Too... | """
This is still an experimental module and there will almost certainly be backward
incompatible changes coming.
"""
import logging
import os
import re
from typing import (
List,
Optional,
)
import galaxy.tool_util.deps.installable
from galaxy.tool_util.deps.requirements import (
ToolRequirement,
Too... |
46,068 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/conda.py | 441,442 | 400,451 | shell_commands | MergedCondaDependency | 442,451 | 442,451 | class MergedCondaDependency(Dependency):
dict_collection_visible_keys = Dependency.dict_collection_visible_keys + [
"environment_path",
"name",
"version",
"dependency_resolver",
]
dependency_type = "conda"
def __init__(
self,
conda_context: CondaContext,
... | class MergedCondaDependency(Dependency):
dict_collection_visible_keys = Dependency.dict_collection_visible_keys + [
"environment_path",
"name",
"version",
"dependency_resolver",
]
dependency_type = "conda"
def __init__(
self,
conda_context: CondaContext,
... | if self._preserve_python_environment:
# On explicit testing the only such requirement I am aware of is samtools - and it seems to work
# fine with just appending the PATH as done below. Other tools may require additional
# variables in the future.
return f"""expor... | if self._preserve_python_environment:
# On explicit testing the only such requirement I am aware of is samtools - and it seems to work
# fine with just appending the PATH as done below. Other tools may require additional
# variables in the future.
return f"""expor... | 50 | 331 | 131 | 462 | """
This is still an experimental module and there will almost certainly be backward
incompatible changes coming.
"""
import logging
import os
import re
from typing import (
List,
Optional,
)
import galaxy.tool_util.deps.installable
from galaxy.tool_util.deps.requirements import (
ToolRequirement,
Too... | """
This is still an experimental module and there will almost certainly be backward
incompatible changes coming.
"""
import logging
import os
import re
from typing import (
List,
Optional,
)
import galaxy.tool_util.deps.installable
from galaxy.tool_util.deps.requirements import (
ToolRequirement,
Too... |
46,069 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/galaxy_packages.py | 138,139 | 1,143 | _is_dependency_directory | 139,142 | 139,142 | import logging
from os import listdir
from os.path import (
basename,
exists,
isdir,
islink,
join,
realpath,
)
from . import (
Dependency,
DependencyResolver,
ListableDependencyResolver,
MappableDependencyResolver,
NullDependency,
)
from .resolver_mixins import UsesToolDepen... | import logging
from os import listdir
from os.path import (
basename,
exists,
isdir,
islink,
join,
realpath,
)
from . import (
Dependency,
DependencyResolver,
ListableDependencyResolver,
MappableDependencyResolver,
NullDependency,
)
from .resolver_mixins import UsesToolDepen... | return exists(join(directory, "env.sh")) or exists(join(directory, "bin"))
| return exists(join(directory, "env.sh")) or exists(join(directory, "bin"))
| 6 | 1,470 | 29 | 1,499 | import logging
from os import listdir
from os.path import (
basename,
exists,
isdir,
islink,
join,
realpath,
)
from . import (
Dependency,
DependencyResolver,
ListableDependencyResolver,
MappableDependencyResolver,
NullDependency,
)
from .resolver_mixins import UsesToolDepen... | import logging
from os import listdir
from os.path import (
basename,
exists,
isdir,
islink,
join,
realpath,
)
from . import (
Dependency,
DependencyResolver,
ListableDependencyResolver,
MappableDependencyResolver,
NullDependency,
)
from .resolver_mixins import UsesToolDepen... | |
46,070 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/galaxy_packages.py | 87,88 | 61,111 | _find_dep_versioned | BaseGalaxyPackageDependencyResolver | 88,92 | 88,92 | class BaseGalaxyPackageDependencyResolver(DependencyResolver, UsesToolDependencyDirMixin):
dict_collection_visible_keys = DependencyResolver.dict_collection_visible_keys + ["base_path", "versionless"]
dependency_type = GalaxyPackageDependency
def __init__(self, dependency_manager, **kwds):
# Galaxy... | class BaseGalaxyPackageDependencyResolver(DependencyResolver, UsesToolDependencyDirMixin):
dict_collection_visible_keys = DependencyResolver.dict_collection_visible_keys + ["base_path", "versionless"]
dependency_type = GalaxyPackageDependency
def __init__(self, dependency_manager, **kwds):
# Galaxy... | base_path = self.base_path
path = join(base_path, name, version)
return self._galaxy_package_dep(path, version, name, type, True)
| base_path = self.base_path
path = join(base_path, name, version)
return self._galaxy_package_dep(path, version, name, type, True)
| 14 | 659 | 52 | 711 | import logging
from os import listdir
from os.path import (
basename,
exists,
isdir,
islink,
join,
realpath,
)
from . import (
Dependency,
DependencyResolver,
ListableDependencyResolver,
MappableDependencyResolver,
NullDependency,
)
from .resolver_mixins import UsesToolDepen... | import logging
from os import listdir
from os.path import (
basename,
exists,
isdir,
islink,
join,
realpath,
)
from . import (
Dependency,
DependencyResolver,
ListableDependencyResolver,
MappableDependencyResolver,
NullDependency,
)
from .resolver_mixins import UsesToolDepen... |
46,071 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/galaxy_packages.py | 44,46 | 24,57 | exact | GalaxyPackageDependency | 46,48 | 46,48 | class GalaxyPackageDependency(Dependency):
dict_collection_visible_keys = Dependency.dict_collection_visible_keys + [
"script",
"path",
"version",
"name",
"dependency_resolver",
]
dependency_type = "galaxy_package"
def __init__(self, script, path, name, type, ver... | class GalaxyPackageDependency(Dependency):
dict_collection_visible_keys = Dependency.dict_collection_visible_keys + [
"script",
"path",
"version",
"name",
"dependency_resolver",
]
dependency_type = "galaxy_package"
def __init__(self, script, path, name, type, ver... | return self._exact
| return self._exact
| 2 | 313 | 9 | 322 | import logging
from os import listdir
from os.path import (
basename,
exists,
isdir,
islink,
join,
realpath,
)
from . import (
Dependency,
DependencyResolver,
ListableDependencyResolver,
MappableDependencyResolver,
NullDependency,
)
from .resolver_mixins import UsesToolDepen... | import logging
from os import listdir
from os.path import (
basename,
exists,
isdir,
islink,
join,
realpath,
)
from . import (
Dependency,
DependencyResolver,
ListableDependencyResolver,
MappableDependencyResolver,
NullDependency,
)
from .resolver_mixins import UsesToolDepen... |
46,072 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/galaxy_packages.py | 124,125 | 111,138 | list_dependencies | GalaxyPackageDependencyResolver | 125,138 | 125,138 | class GalaxyPackageDependencyResolver(
BaseGalaxyPackageDependencyResolver, ListableDependencyResolver, MappableDependencyResolver
):
resolver_type = "galaxy_packages"
def __init__(self, dependency_manager, **kwds):
super().__init__(dependency_manager, **kwds)
self._setup_mapping(dependency... | class GalaxyPackageDependencyResolver(
BaseGalaxyPackageDependencyResolver, ListableDependencyResolver, MappableDependencyResolver
):
resolver_type = "galaxy_packages"
def __init__(self, dependency_manager, **kwds):
super().__init__(dependency_manager, **kwds)
self._setup_mapping(dependency... | base_path = self.base_path
for package_name in listdir(base_path):
package_dir = join(base_path, package_name)
if isdir(package_dir):
for version in listdir(package_dir):
version_dir = join(package_dir, version)
if version =... | base_path = self.base_path
for package_name in listdir(base_path):
package_dir = join(base_path, package_name)
if isdir(package_dir):
for version in listdir(package_dir):
version_dir = join(package_dir, version)
if version =... | 36 | 152 | 145 | 297 | import logging
from os import listdir
from os.path import (
basename,
exists,
isdir,
islink,
join,
realpath,
)
from . import (
Dependency,
DependencyResolver,
ListableDependencyResolver,
MappableDependencyResolver,
NullDependency,
)
from .resolver_mixins import UsesToolDepen... | import logging
from os import listdir
from os.path import (
basename,
exists,
isdir,
islink,
join,
realpath,
)
from . import (
Dependency,
DependencyResolver,
ListableDependencyResolver,
MappableDependencyResolver,
NullDependency,
)
from .resolver_mixins import UsesToolDepen... |
46,073 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/homebrew.py | 56,57 | 1,61 | _string_as_bool | 57,60 | 57,60 | """
This file implements a brew resolver for Galaxy requirements. In order for Galaxy
to pick up on recursively defined and versioned brew dependencies recipes should
be installed using the experimental `brew-vinstall` external command.
More information here:
https://github.com/jmchilton/brew-tests
https://github.com... | """
This file implements a brew resolver for Galaxy requirements. In order for Galaxy
to pick up on recursively defined and versioned brew dependencies recipes should
be installed using the experimental `brew-vinstall` external command.
More information here:
https://github.com/jmchilton/brew-tests
https://github.com... | return str(value).lower() == "true"
| return str(value).lower() == "true"
| 4 | 612 | 18 | 630 | """
This file implements a brew resolver for Galaxy requirements. In order for Galaxy
to pick up on recursively defined and versioned brew dependencies recipes should
be installed using the experimental `brew-vinstall` external command.
More information here:
https://github.com/jmchilton/brew-tests
https://github.com... | """
This file implements a brew resolver for Galaxy requirements. In order for Galaxy
to pick up on recursively defined and versioned brew dependencies recipes should
be installed using the experimental `brew-vinstall` external command.
More information here:
https://github.com/jmchilton/brew-tests
https://github.com... | |
46,074 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/homebrew.py | 44,45 | 29,56 | resolve | HomebrewDependencyResolver | 45,56 | 45,56 | class HomebrewDependencyResolver(DependencyResolver, UsesHomebrewMixin):
resolver_type = "homebrew"
def __init__(self, dependency_manager, **kwds):
self.versionless = _string_as_bool(kwds.get("versionless", "false"))
self.prefer_version = kwds.get("prefer_version", None)
if self.prefer... | class HomebrewDependencyResolver(DependencyResolver, UsesHomebrewMixin):
resolver_type = "homebrew"
def __init__(self, dependency_manager, **kwds):
self.versionless = _string_as_bool(kwds.get("versionless", "false"))
self.prefer_version = kwds.get("prefer_version", None)
if self.prefer... | name, version, type = requirement.name, requirement.version, requirement.type
if type != "package":
return NullDependency(version=version, name=name)
if version is None or self.versionless:
return self._find_dep_default(name, version)
else:
return se... | name, version, type = requirement.name, requirement.version, requirement.type
if type != "package":
return NullDependency(version=version, name=name)
if version is None or self.versionless:
return self._find_dep_default(name, version)
else:
return se... | 27 | 207 | 104 | 311 | """
This file implements a brew resolver for Galaxy requirements. In order for Galaxy
to pick up on recursively defined and versioned brew dependencies recipes should
be installed using the experimental `brew-vinstall` external command.
More information here:
https://github.com/jmchilton/brew-tests
https://github.com... | """
This file implements a brew resolver for Galaxy requirements. In order for Galaxy
to pick up on recursively defined and versioned brew dependencies recipes should
be installed using the experimental `brew-vinstall` external command.
More information here:
https://github.com/jmchilton/brew-tests
https://github.com... |
46,076 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/lmod.py | 84,85 | 77,140 | has_module | AvailModuleChecker | 85,100 | 85,100 | class AvailModuleChecker:
"""Parses the output of Lmod 'module avail' command to get the list of available modules."""
def __init__(self, lmod_dependency_resolver, modulepath):
self.lmod_dependency_resolver = lmod_dependency_resolver
self.modulepath = modulepath
def has_module(self, module... | class AvailModuleChecker:
"""Parses the output of Lmod 'module avail' command to get the list of available modules."""
def __init__(self, lmod_dependency_resolver, modulepath):
self.lmod_dependency_resolver = lmod_dependency_resolver
self.modulepath = modulepath
def has_module(self, module... | # When version is None (No specific version required by the wrapper -or- versionless is set to 'true'), we only get the list of default modules
# We get the full list of modules otherwise
if version is None:
available_modules = self.__get_list_of_available_modules(True)
else:... | # When version is None (No specific version required by the wrapper -or- versionless is set to 'true'), we only get the list of default modules
# We get the full list of modules otherwise
if version is None:
available_modules = self.__get_list_of_available_modules(True)
else:... | 85 | 627 | 192 | 819 | """
This is a prototype dependency resolver to be able to use the "LMOD environment modules system" from TACC to solve package requirements
LMOD official website: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod
LMOD @ Github: https://github.com/TACC/Lmod
"""
import logging
from io import StringI... | """
This is a prototype dependency resolver to be able to use the "LMOD environment modules system" from TACC to solve package requirements
LMOD official website: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod
LMOD @ Github: https://github.com/TACC/Lmod
"""
import logging
from io import StringI... |
46,077 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/lmod.py | 171,172 | 140,191 | shell_commands | LmodDependency | 172,191 | 172,191 | class LmodDependency(Dependency):
"""Prepare the commands required to solve the dependency and add them to the script used to run a tool in Galaxy."""
dict_collection_visible_keys = Dependency.dict_collection_visible_keys + [
"module_name",
"module_version",
"dependency_resolver",
]... | class LmodDependency(Dependency):
"""Prepare the commands required to solve the dependency and add them to the script used to run a tool in Galaxy."""
dict_collection_visible_keys = Dependency.dict_collection_visible_keys + [
"module_name",
"module_version",
"dependency_resolver",
]... | # Get the full module name in the form "tool_name/tool_version"
module_to_load = self.module_name
if self.module_version:
module_to_load = f"{self.module_name}/{self.module_version}"
# Build the list of command to add to run script
# Note that since "module" is actua... | # Get the full module name in the form "tool_name/tool_version"
module_to_load = self.module_name
if self.module_version:
module_to_load = f"{self.module_name}/{self.module_version}"
# Build the list of command to add to run script
# Note that since "module" is actua... | 107 | 277 | 307 | 584 | """
This is a prototype dependency resolver to be able to use the "LMOD environment modules system" from TACC to solve package requirements
LMOD official website: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod
LMOD @ Github: https://github.com/TACC/Lmod
"""
import logging
from io import StringI... | """
This is a prototype dependency resolver to be able to use the "LMOD environment modules system" from TACC to solve package requirements
LMOD official website: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod
LMOD @ Github: https://github.com/TACC/Lmod
"""
import logging
from io import StringI... |
46,078 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/lmod.py | 59,60 | 36,77 | resolve | LmodDependencyResolver | 60,73 | 60,73 | class LmodDependencyResolver(DependencyResolver, MappableDependencyResolver):
"""Dependency resolver based on the LMOD environment modules system"""
dict_collection_visible_keys = DependencyResolver.dict_collection_visible_keys + ["base_path", "modulepath"]
resolver_type = "lmod"
def __init__(self, de... | class LmodDependencyResolver(DependencyResolver, MappableDependencyResolver):
"""Dependency resolver based on the LMOD environment modules system"""
dict_collection_visible_keys = DependencyResolver.dict_collection_visible_keys + ["base_path", "modulepath"]
resolver_type = "lmod"
def __init__(self, de... | requirement = self._expand_mappings(requirement)
name, version, type = requirement.name, requirement.version, requirement.type
if type != "package":
return NullDependency(version=version, name=name)
if self.__has_module(name, version):
return LmodDependency(self... | requirement = self._expand_mappings(requirement)
name, version, type = requirement.name, requirement.version, requirement.type
if type != "package":
return NullDependency(version=version, name=name)
if self.__has_module(name, version):
return LmodDependency(self... | 40 | 384 | 166 | 550 | """
This is a prototype dependency resolver to be able to use the "LMOD environment modules system" from TACC to solve package requirements
LMOD official website: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod
LMOD @ Github: https://github.com/TACC/Lmod
"""
import logging
from io import StringI... | """
This is a prototype dependency resolver to be able to use the "LMOD environment modules system" from TACC to solve package requirements
LMOD official website: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod
LMOD @ Github: https://github.com/TACC/Lmod
"""
import logging
from io import StringI... |
46,080 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/modules.py | 156,157 | 136,191 | has_module | AvailModuleChecker | 157,168 | 157,168 | class AvailModuleChecker:
"""Finds modules by searching output of 'module avail'.
Parses the Environment Modules 'module avail' output, splitting
module names into module and version on '/' and discarding a postfix matching default_indicator
(by default '(default)'. Matching is done using the module an... | class AvailModuleChecker:
"""Finds modules by searching output of 'module avail'.
Parses the Environment Modules 'module avail' output, splitting
module names into module and version on '/' and discarding a postfix matching default_indicator
(by default '(default)'. Matching is done using the module an... | module_generator = self.prefetched_modules
if module_generator is None:
module_generator = self.__modules()
for module_name, module_version in module_generator:
names_match = module == module_name
module_match = names_match and (version is None or module_vers... | module_generator = self.prefetched_modules
if module_generator is None:
module_generator = self.__modules()
for module_name, module_version in module_generator:
names_match = module == module_name
module_match = names_match and (version is None or module_vers... | 37 | 516 | 107 | 623 | """
This file contains the outline of an implementation to load environment modules
(http://modules.sourceforge.net/).
This is a community contributed feature and the core Galaxy team does utilize
it, hence support for it will be minimal. The Galaxy team eagerly welcomes
community contribution and maintenance however.... | """
This file contains the outline of an implementation to load environment modules
(http://modules.sourceforge.net/).
This is a community contributed feature and the core Galaxy team does utilize
it, hence support for it will be minimal. The Galaxy team eagerly welcomes
community contribution and maintenance however.... |
46,081 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/modules.py | 120,121 | 106,136 | has_module | DirectoryModuleChecker | 121,136 | 121,136 | class DirectoryModuleChecker:
"""Finds module by path.
Searches the paths listed in modulepath to for a file or directory matching the module name.
If the version=True, searches for files named module/version."""
def __init__(self, module_dependency_resolver, modulepath, prefetch):
self.module... | class DirectoryModuleChecker:
"""Finds module by path.
Searches the paths listed in modulepath to for a file or directory matching the module name.
If the version=True, searches for files named module/version."""
def __init__(self, module_dependency_resolver, modulepath, prefetch):
self.module... | has_module = False
for directory in self.directories:
module_directory = join(directory, module)
has_module_directory = isdir(module_directory)
if not version:
has_module = has_module_directory or exists(module_directory) # could be a bare modulefile
... | has_module = False
for directory in self.directories:
module_directory = join(directory, module)
has_module_directory = isdir(module_directory)
if not version:
has_module = has_module_directory or exists(module_directory) # could be a bare modulefile
... | 46 | 171 | 154 | 325 | """
This file contains the outline of an implementation to load environment modules
(http://modules.sourceforge.net/).
This is a community contributed feature and the core Galaxy team does utilize
it, hence support for it will be minimal. The Galaxy team eagerly welcomes
community contribution and maintenance however.... | """
This file contains the outline of an implementation to load environment modules
(http://modules.sourceforge.net/).
This is a community contributed feature and the core Galaxy team does utilize
it, hence support for it will be minimal. The Galaxy team eagerly welcomes
community contribution and maintenance however.... |
46,082 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/modules.py | 226,227 | 191,234 | shell_commands | ModuleDependency | 227,234 | 227,234 | class ModuleDependency(Dependency):
"""Converts module dependencies into shell expressions using modulecmd.
Using Environment Modules' 'modulecmd' (specifically 'modulecmd sh load') to
convert module specifications into shell expressions for inclusion in
the script used to run a tool in Galaxy."""
... | class ModuleDependency(Dependency):
"""Converts module dependencies into shell expressions using modulecmd.
Using Environment Modules' 'modulecmd' (specifically 'modulecmd sh load') to
convert module specifications into shell expressions for inclusion in
the script used to run a tool in Galaxy."""
... | module_to_load = self.module_name
if self.module_version:
module_to_load = f"{self.module_name}/{self.module_version}"
command = f"MODULEPATH={self.module_dependency_resolver.modulepath}; export MODULEPATH; eval `{self.module_dependency_resolver.modulecmd} sh load {module_to_load}`"
... | module_to_load = self.module_name
if self.module_version:
module_to_load = f"{self.module_name}/{self.module_version}"
command = f"MODULEPATH={self.module_dependency_resolver.modulepath}; export MODULEPATH; eval `{self.module_dependency_resolver.modulecmd} sh load {module_to_load}`"
... | 20 | 305 | 114 | 419 | """
This file contains the outline of an implementation to load environment modules
(http://modules.sourceforge.net/).
This is a community contributed feature and the core Galaxy team does utilize
it, hence support for it will be minimal. The Galaxy team eagerly welcomes
community contribution and maintenance however.... | """
This file contains the outline of an implementation to load environment modules
(http://modules.sourceforge.net/).
This is a community contributed feature and the core Galaxy team does utilize
it, hence support for it will be minimal. The Galaxy team eagerly welcomes
community contribution and maintenance however.... |
46,083 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/modules.py | 88,89 | 45,106 | resolve | ModuleDependencyResolver | 89,102 | 89,102 | class ModuleDependencyResolver(DependencyResolver, MappableDependencyResolver):
dict_collection_visible_keys = DependencyResolver.dict_collection_visible_keys + [
"base_path",
"modulepath",
"modulecmd",
"prefetch",
"default_indicator",
"find_by",
]
resolver_ty... | class ModuleDependencyResolver(DependencyResolver, MappableDependencyResolver):
dict_collection_visible_keys = DependencyResolver.dict_collection_visible_keys + [
"base_path",
"modulepath",
"modulecmd",
"prefetch",
"default_indicator",
"find_by",
]
resolver_ty... | requirement = self._expand_mappings(requirement)
name, version, type = requirement.name, requirement.version, requirement.type
if type != "package":
return NullDependency(version=version, name=name)
if self.__has_module(name, version):
return ModuleDependency(se... | requirement = self._expand_mappings(requirement)
name, version, type = requirement.name, requirement.version, requirement.type
if type != "package":
return NullDependency(version=version, name=name)
if self.__has_module(name, version):
return ModuleDependency(se... | 40 | 630 | 164 | 794 | """
This file contains the outline of an implementation to load environment modules
(http://modules.sourceforge.net/).
This is a community contributed feature and the core Galaxy team does utilize
it, hence support for it will be minimal. The Galaxy team eagerly welcomes
community contribution and maintenance however.... | """
This file contains the outline of an implementation to load environment modules
(http://modules.sourceforge.net/).
This is a community contributed feature and the core Galaxy team does utilize
it, hence support for it will be minimal. The Galaxy team eagerly welcomes
community contribution and maintenance however.... |
46,084 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/resolvers/tool_shed_packages.py | 54,55 | 15,85 | _get_package_installed_dependency_path | ToolShedPackageDependencyResolver | 55,66 | 55,66 | class ToolShedPackageDependencyResolver(BaseGalaxyPackageDependencyResolver, UsesInstalledRepositoriesMixin):
resolver_type = "tool_shed_packages"
# Resolution of these dependencies depends on more than just the requirement
# tag, it depends on the tool installation context - therefore these are
# non-s... | class ToolShedPackageDependencyResolver(BaseGalaxyPackageDependencyResolver, UsesInstalledRepositoriesMixin):
resolver_type = "tool_shed_packages"
# Resolution of these dependencies depends on more than just the requirement
# tag, it depends on the tool installation context - therefore these are
# non-s... | tool_shed_repository = installed_tool_dependency.tool_shed_repository
base_path = self.base_path
return join(
base_path,
name,
version,
tool_shed_repository.owner,
tool_shed_repository.name,
tool_shed_repository.installed_ch... | tool_shed_repository = installed_tool_dependency.tool_shed_repository
base_path = self.base_path
return join(
base_path,
name,
version,
tool_shed_repository.owner,
tool_shed_repository.name,
tool_shed_repository.installed_ch... | 15 | 740 | 105 | 845 | from os.path import (
abspath,
exists,
join,
)
from . import NullDependency
from .galaxy_packages import (
BaseGalaxyPackageDependencyResolver,
ToolShedDependency,
)
from .resolver_mixins import UsesInstalledRepositoriesMixin
class ToolShedPackageDependencyResolver(BaseGalaxyPackageDependencyReso... | from os.path import (
abspath,
exists,
join,
)
from . import NullDependency
from .galaxy_packages import (
BaseGalaxyPackageDependencyResolver,
ToolShedDependency,
)
from .resolver_mixins import UsesInstalledRepositoriesMixin
class ToolShedPackageDependencyResolver(BaseGalaxyPackageDependencyReso... |
46,085 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/deps/singularity_util.py | 61,76 | 1,123 | build_singularity_run_command | 76,108 | 76,108 | import os
import shlex
from typing import (
List,
Optional,
Tuple,
TYPE_CHECKING,
Union,
)
if TYPE_CHECKING:
from .container_volumes import DockerVolume
DEFAULT_WORKING_DIRECTORY = None
DEFAULT_SINGULARITY_COMMAND = "singularity"
DEFAULT_CLEANENV = True
DEFAULT_NO_MOUNT = ["tmp"]
DEFAULT_SUDO ... | import os
import shlex
from typing import (
List,
Optional,
Tuple,
TYPE_CHECKING,
Union,
)
if TYPE_CHECKING:
from .container_volumes import DockerVolume
DEFAULT_WORKING_DIRECTORY = None
DEFAULT_SINGULARITY_COMMAND = "singularity"
DEFAULT_CLEANENV = True
DEFAULT_NO_MOUNT = ["tmp"]
DEFAULT_SUDO ... | volumes = volumes or []
env = env or []
command_parts = []
# http://singularity.lbl.gov/docs-environment-metadata
home = None
for key, value in env:
if key == "HOME":
home = value
command_parts.extend([f'SINGULARITYENV_{key}="{value}"'])
command_parts += _singular... | volumes = volumes or []
env = env or []
command_parts = []
# http://singularity.lbl.gov/docs-environment-metadata
home = None
for key, value in env:
if key == "HOME":
home = value
command_parts.extend([f'SINGULARITYENV_{key}="{value}"'])
command_parts += _singular... | 71 | 977 | 364 | 1,341 | import os
import shlex
from typing import (
List,
Optional,
Tuple,
TYPE_CHECKING,
Union,
)
if TYPE_CHECKING:
from .container_volumes import DockerVolume
DEFAULT_WORKING_DIRECTORY = None
DEFAULT_SINGULARITY_COMMAND = "singularity"
DEFAULT_CLEANENV = True
DEFAULT_NO_MOUNT = ["tmp"]
DEFAULT_SUDO ... | import os
import shlex
from typing import (
List,
Optional,
Tuple,
TYPE_CHECKING,
Union,
)
if TYPE_CHECKING:
from .container_volumes import DockerVolume
DEFAULT_WORKING_DIRECTORY = None
DEFAULT_SINGULARITY_COMMAND = "singularity"
DEFAULT_CLEANENV = True
DEFAULT_NO_MOUNT = ["tmp"]
DEFAULT_SUDO ... | |
46,086 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/fetcher.py | 22,23 | 13,35 | to_tool_path | ToolLocationFetcher | 23,35 | 23,35 | class ToolLocationFetcher:
def __init__(self):
self.resolver_classes = self.__resolvers_dict()
def __resolvers_dict(self) -> Dict[str, Type["ToolLocationResolver"]]:
import galaxy.tool_util.locations
return plugin_config.plugins_dict(galaxy.tool_util.locations, "scheme")
def to_to... | class ToolLocationFetcher:
def __init__(self):
self.resolver_classes = self.__resolvers_dict()
def __resolvers_dict(self) -> Dict[str, Type["ToolLocationResolver"]]:
import galaxy.tool_util.locations
return plugin_config.plugins_dict(galaxy.tool_util.locations, "scheme")
def to_to... | if "://" not in path_or_uri_like:
path = path_or_uri_like
else:
uri_like = path_or_uri_like
if ":" not in path_or_uri_like:
raise Exception("Invalid URI passed to get_tool_source")
scheme = uri_like.split(":", 2)[0]
if scheme no... | if "://" not in path_or_uri_like:
path = path_or_uri_like
else:
uri_like = path_or_uri_like
if ":" not in path_or_uri_like:
raise Exception("Invalid URI passed to get_tool_source")
scheme = uri_like.split(":", 2)[0]
if scheme no... | 45 | 134 | 170 | 304 | from typing import (
Dict,
Type,
TYPE_CHECKING,
)
from galaxy.util import plugin_config
if TYPE_CHECKING:
from galaxy.tool_util.locations import ToolLocationResolver
class ToolLocationFetcher:
def __init__(self):
self.resolver_classes = self.__resolvers_dict()
def __resolvers_dict(s... | from typing import (
Dict,
Type,
TYPE_CHECKING,
)
from galaxy.util import plugin_config
if TYPE_CHECKING:
from galaxy.tool_util.locations import ToolLocationResolver
class ToolLocationFetcher:
def __init__(self):
self.resolver_classes = self.__resolvers_dict()
def __resolvers_dict(s... |
46,087 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/_util.py | 9,10 | 1,12 | is_valid_cheetah_placeholder | 11,12 | 10,12 | import re
def is_datasource(tool_xml):
"""Returns true if the tool is a datasource tool"""
return tool_xml.getroot().attrib.get("tool_type", "") in ["data_source", "data_source_async"]
def is_valid_cheetah_placeholder(name):
FILL_FUNC_BODY | import re
def is_datasource(tool_xml):
"""Returns true if the tool is a datasource tool"""
return tool_xml.getroot().attrib.get("tool_type", "") in ["data_source", "data_source_async"]
def is_valid_cheetah_placeholder(name):
"""Returns true if name is a valid Cheetah placeholder"""
FILL_FUNC_BODY | return re.match(r"^[a-zA-Z_]\w*$", name) is not None
| """Returns true if name is a valid Cheetah placeholder"""
return re.match(r"^[a-zA-Z_]\w*$", name) is not None
| 6 | 107 | 29 | 136 | import re
def is_datasource(tool_xml):
"""Returns true if the tool is a datasource tool"""
return tool_xml.getroot().attrib.get("tool_type", "") in ["data_source", "data_source_async"]
def is_valid_cheetah_placeholder(name):
FILL_FUNC_BODY | import re
def is_datasource(tool_xml):
"""Returns true if the tool is a datasource tool"""
return tool_xml.getroot().attrib.get("tool_type", "") in ["data_source", "data_source_async"]
def is_valid_cheetah_placeholder(name):
"""Returns true if name is a valid Cheetah placeholder"""
FILL_FUNC_BODY | |
46,088 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/citations.py | 46,48 | 45,60 | lint | CitationsFound | 48,60 | 48,60 | class CitationsFound(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CitationsFound(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
root = tool_xml.find("./citations")
if root is None:
root = tool_xml.getroot()
citations = tool_xml.find("citations")
if citations is not None and len(citations) > 0:
... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
root = tool_xml.find("./citations")
if root is None:
root = tool_xml.getroot()
citations = tool_xml.find("citations")
if citations is not None and len(citations) > 0:
... | 36 | 51 | 141 | 192 | """This module contains citation linters.
Citations describe references that should be used when consumers
of the tool publish results.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser.i... | """This module contains citation linters.
Citations describe references that should be used when consumers
of the tool publish results.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser.i... |
46,089 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/citations.py | 17,19 | 16,30 | lint | CitationsMissing | 19,30 | 19,30 | class CitationsMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CitationsMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
root = tool_xml.find("./citations")
if root is None:
root = tool_xml.getroot()
citations = tool_xml.findall("citations")
if len(citations) == 0:
lint_ctx.warn("No... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
root = tool_xml.find("./citations")
if root is None:
root = tool_xml.getroot()
citations = tool_xml.findall("citations")
if len(citations) == 0:
lint_ctx.warn("No... | 37 | 51 | 135 | 186 | """This module contains citation linters.
Citations describe references that should be used when consumers
of the tool publish results.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser.i... | """This module contains citation linters.
Citations describe references that should be used when consumers
of the tool publish results.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser.i... |
46,090 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/citations.py | 31,33 | 30,45 | lint | CitationsNoText | 33,45 | 33,45 | class CitationsNoText(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CitationsNoText(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
citations = tool_xml.find("citations")
if citations is None:
return
for citation in citations:
citation_type = citation.attrib.get("type")
if citation_type in... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
citations = tool_xml.find("citations")
if citations is None:
return
for citation in citations:
citation_type = citation.attrib.get("type")
if citation_type in... | 41 | 52 | 163 | 215 | """This module contains citation linters.
Citations describe references that should be used when consumers
of the tool publish results.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser.i... | """This module contains citation linters.
Citations describe references that should be used when consumers
of the tool publish results.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser.i... |
46,091 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/citations.py | 61,63 | 60,74 | lint | CitationsNoValid | 63,74 | 63,74 | class CitationsNoValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CitationsNoValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
root = tool_xml.find("./citations")
if root is None:
root = tool_xml.getroot()
citations = tool_xml.findall("citations")
if len(citations) != 1:
return
if... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
root = tool_xml.find("./citations")
if root is None:
root = tool_xml.getroot()
citations = tool_xml.findall("citations")
if len(citations) != 1:
return
if... | 37 | 52 | 143 | 195 | """This module contains citation linters.
Citations describe references that should be used when consumers
of the tool publish results.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser.i... | """This module contains citation linters.
Citations describe references that should be used when consumers
of the tool publish results.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser.i... |
46,092 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/command.py | 33,35 | 32,46 | lint | CommandEmpty | 35,46 | 35,46 | class CommandEmpty(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CommandEmpty(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
root = tool_xml.find("./command")
if root is None:
root = tool_xml.getroot()
command = tool_xml.find("./command")
if command is not None and command.text is None:
... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
root = tool_xml.find("./command")
if root is None:
root = tool_xml.getroot()
command = tool_xml.find("./command")
if command is not None and command.text is None:
... | 36 | 50 | 126 | 176 | """This module contains linters for a tool's command description.
A command description describes how to build the command-line to execute
from supplied inputs.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from ... | """This module contains linters for a tool's command description.
A command description describes how to build the command-line to execute
from supplied inputs.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from ... |
46,093 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/command.py | 72,74 | 71,85 | lint | CommandInfo | 74,85 | 74,85 | class CommandInfo(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CommandInfo(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
command = tool_xml.find("./command")
if command is None:
return
interpreter_type = command.attrib.get("interpreter", None)
interpreter_info = ""
if interpreter_type:
... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
command = tool_xml.find("./command")
if command is None:
return
interpreter_type = command.attrib.get("interpreter", None)
interpreter_info = ""
if interpreter_type:
... | 40 | 50 | 158 | 208 | """This module contains linters for a tool's command description.
A command description describes how to build the command-line to execute
from supplied inputs.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from ... | """This module contains linters for a tool's command description.
A command description describes how to build the command-line to execute
from supplied inputs.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from ... |
46,094 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/command.py | 58,60 | 57,71 | lint | CommandInterpreterDeprecated | 60,71 | 60,71 | class CommandInterpreterDeprecated(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CommandInterpreterDeprecated(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
command = tool_xml.find("./command")
if command is None:
return
interpreter_type = command.attrib.get("interpreter", None)
if interpreter_type is not None:
lint_c... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
command = tool_xml.find("./command")
if command is None:
return
interpreter_type = command.attrib.get("interpreter", None)
if interpreter_type is not None:
lint_c... | 33 | 54 | 129 | 183 | """This module contains linters for a tool's command description.
A command description describes how to build the command-line to execute
from supplied inputs.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from ... | """This module contains linters for a tool's command description.
A command description describes how to build the command-line to execute
from supplied inputs.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from ... |
46,095 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/command.py | 17,19 | 16,32 | lint | CommandMissing | 19,32 | 19,32 | class CommandMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CommandMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
root = tool_xml.find("./command")
if root is None:
root = tool_xml.getroot()
command = tool_xml.find("./command")
if command is None:
lint_ctx.error(
... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
root = tool_xml.find("./command")
if root is None:
root = tool_xml.getroot()
command = tool_xml.find("./command")
if command is None:
lint_ctx.error(
... | 41 | 50 | 135 | 185 | """This module contains linters for a tool's command description.
A command description describes how to build the command-line to execute
from supplied inputs.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from ... | """This module contains linters for a tool's command description.
A command description describes how to build the command-line to execute
from supplied inputs.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from ... |
46,096 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/command.py | 47,49 | 46,57 | lint | CommandTODO | 49,57 | 49,57 | class CommandTODO(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CommandTODO(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
command = tool_xml.find("./command")
if command is not None and command.text is not None and "TODO" in command.text:
lint_ctx.warn("Command template contains TODO text.", linter=cls.name(), ... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
command = tool_xml.find("./command")
if command is not None and command.text is not None and "TODO" in command.text:
lint_ctx.warn("Command template contains TODO text.", linter=cls.name(), ... | 33 | 51 | 104 | 155 | """This module contains linters for a tool's command description.
A command description describes how to build the command-line to execute
from supplied inputs.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from ... | """This module contains linters for a tool's command description.
A command description describes how to build the command-line to execute
from supplied inputs.
"""
from typing import TYPE_CHECKING
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from ... |
46,097 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/cwl.py | 81,83 | 80,88 | lint | CWLDescriptionMissing | 83,88 | 83,88 | class CWLDescriptionMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CWLDescriptionMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | help = tool_source.parse_help()
if not help:
lint_ctx.warn("Description of tool is empty or absent.")
| help = tool_source.parse_help()
if not help:
lint_ctx.warn("Description of tool is empty or absent.")
| 13 | 53 | 42 | 95 | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... |
46,098 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/cwl.py | 72,74 | 71,80 | lint | CWLDockerGood | 74,80 | 74,80 | class CWLDockerGood(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CWLDockerGood(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, containers, *_ = tool_source.parse_requirements_and_containers()
if len(containers) > 0:
identifier = containers[0].identifier
lint_ctx.info(f"Tool will run in Docker image [{identifier}].")
| _, containers, *_ = tool_source.parse_requirements_and_containers()
if len(containers) > 0:
identifier = containers[0].identifier
lint_ctx.info(f"Tool will run in Docker image [{identifier}].")
| 19 | 53 | 73 | 126 | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... |
46,099 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/cwl.py | 64,66 | 63,71 | lint | CWLDockerMissing | 66,71 | 66,71 | class CWLDockerMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CWLDockerMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, containers, *_ = tool_source.parse_requirements_and_containers()
if len(containers) == 0:
lint_ctx.warn("Tool does not specify a DockerPull source.")
| _, containers, *_ = tool_source.parse_requirements_and_containers()
if len(containers) == 0:
lint_ctx.warn("Tool does not specify a DockerPull source.")
| 16 | 53 | 60 | 113 | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... |
46,100 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/cwl.py | 89,91 | 88,94 | lint | CWLHelpTODO | 91,94 | 91,94 | class CWLHelpTODO(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CWLHelpTODO(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | help = tool_source.parse_help()
if help and "TODO" in help:
lint_ctx.warn("Help contains TODO text.")
| help = tool_source.parse_help()
if help and "TODO" in help:
lint_ctx.warn("Help contains TODO text.")
| 13 | 54 | 41 | 95 | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... |
46,101 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/cwl.py | 27,29 | 26,36 | lint | CWLInValid | 29,36 | 29,36 | class CWLInValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CWLInValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | raw_reference = schema_loader.raw_process_reference(tool_source.source_path)
try:
schema_loader.process_definition(raw_reference)
except Exception as e:
lint_ctx.error(f"Failed to valdiate CWL artifact: {e}")
| raw_reference = schema_loader.raw_process_reference(tool_source.source_path)
try:
schema_loader.process_definition(raw_reference)
except Exception as e:
lint_ctx.error(f"Failed to valdiate CWL artifact: {e}")
| 15 | 53 | 83 | 136 | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... |
46,102 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/cwl.py | 16,18 | 15,26 | lint | CWLValid | 18,26 | 18,26 | class CWLValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CWLValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | raw_reference = schema_loader.raw_process_reference(tool_source.source_path)
try:
schema_loader.process_definition(raw_reference)
except Exception:
return
lint_ctx.info("CWL appears to be valid.")
| raw_reference = schema_loader.raw_process_reference(tool_source.source_path)
try:
schema_loader.process_definition(raw_reference)
except Exception:
return
lint_ctx.info("CWL appears to be valid.")
| 13 | 52 | 77 | 129 | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... |
46,103 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/cwl.py | 55,57 | 54,63 | lint | CWLVersionGood | 57,63 | 57,63 | class CWLVersionGood(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CWLVersionGood(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | raw_reference = schema_loader.raw_process_reference(tool_source.source_path)
cwl_version = raw_reference.process_object.get("cwlVersion", None)
if cwl_version in ["v1.0"]:
lint_ctx.info(f"Modern CWL version [{cwl_version}].")
| raw_reference = schema_loader.raw_process_reference(tool_source.source_path)
cwl_version = raw_reference.process_object.get("cwlVersion", None)
if cwl_version in ["v1.0"]:
lint_ctx.info(f"Modern CWL version [{cwl_version}].")
| 15 | 53 | 95 | 148 | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... |
46,104 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/cwl.py | 37,39 | 36,45 | lint | CWLVersionMissing | 39,45 | 39,45 | class CWLVersionMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CWLVersionMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | raw_reference = schema_loader.raw_process_reference(tool_source.source_path)
cwl_version = raw_reference.process_object.get("cwlVersion", None)
if cwl_version is None:
lint_ctx.error("CWL file does not contain a 'cwlVersion'")
| raw_reference = schema_loader.raw_process_reference(tool_source.source_path)
cwl_version = raw_reference.process_object.get("cwlVersion", None)
if cwl_version is None:
lint_ctx.error("CWL file does not contain a 'cwlVersion'")
| 18 | 53 | 88 | 141 | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... |
46,105 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/cwl.py | 46,48 | 45,54 | lint | CWLVersionUnknown | 48,54 | 48,54 | class CWLVersionUnknown(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class CWLVersionUnknown(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | raw_reference = schema_loader.raw_process_reference(tool_source.source_path)
cwl_version = raw_reference.process_object.get("cwlVersion", None)
if cwl_version not in ["v1.0"]:
lint_ctx.warn(f"CWL version [{cwl_version}] is unknown, we recommend the v1.0 the stable release.")
| raw_reference = schema_loader.raw_process_reference(tool_source.source_path)
cwl_version = raw_reference.process_object.get("cwlVersion", None)
if cwl_version not in ["v1.0"]:
lint_ctx.warn(f"CWL version [{cwl_version}] is unknown, we recommend the v1.0 the stable release.")
| 24 | 53 | 107 | 160 | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... | """Linter for CWL tools."""
from typing import TYPE_CHECKING
lint_tool_types = ["cwl"]
from galaxy.tool_util.cwl.schema import schema_loader
from galaxy.tool_util.lint import Linter
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource
class CWLVali... |
46,107 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 235,237 | 234,247 | lint | BioToolsValid | 237,247 | 237,247 | class BioToolsValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class BioToolsValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, tool_node = _tool_xml_and_root(tool_source)
xrefs = tool_source.parse_xrefs()
for xref in xrefs:
if xref["reftype"] != "bio.tools":
continue
metadata_source = ApiBiotoolsMetadataSource()
if not metadata_source.get_biotools_metadata(xref["val... | _, tool_node = _tool_xml_and_root(tool_source)
xrefs = tool_source.parse_xrefs()
for xref in xrefs:
if xref["reftype"] != "bio.tools":
continue
metadata_source = ApiBiotoolsMetadataSource()
if not metadata_source.get_biotools_metadata(xref["val... | 29 | 51 | 153 | 204 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,108 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 248,250 | 247,256 | lint | EDAMTermsValid | 250,256 | 250,256 | class EDAMTermsValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class EDAMTermsValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, tool_node = _tool_xml_and_root(tool_source)
edam = load_edam_tree(None, "operation_", "topic_")
terms = tool_source.parse_edam_operations() + tool_source.parse_edam_topics()
for term in terms:
if term not in edam:
lint_ctx.warn(f"No entry '{term}' in EDAM."... | _, tool_node = _tool_xml_and_root(tool_source)
edam = load_edam_tree(None, "operation_", "topic_")
terms = tool_source.parse_edam_operations() + tool_source.parse_edam_topics()
for term in terms:
if term not in edam:
lint_ctx.warn(f"No entry '{term}' in EDAM."... | 30 | 53 | 127 | 180 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,109 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 183,185 | 182,194 | lint | RequirementNameMissing | 185,194 | 185,194 | class RequirementNameMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class RequirementNameMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, tool_node = _tool_xml_and_root(tool_source)
requirements, containers, resource_requirements = tool_source.parse_requirements_and_containers()
for r in requirements:
if r.type != "package":
continue
if not r.name:
lint_ctx.error("Requirem... | _, tool_node = _tool_xml_and_root(tool_source)
requirements, containers, resource_requirements = tool_source.parse_requirements_and_containers()
for r in requirements:
if r.type != "package":
continue
if not r.name:
lint_ctx.error("Requirem... | 27 | 53 | 113 | 166 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,110 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 195,197 | 194,206 | lint | RequirementVersionMissing | 197,206 | 197,206 | class RequirementVersionMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class RequirementVersionMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, tool_node = _tool_xml_and_root(tool_source)
requirements, containers, resource_requirements = tool_source.parse_requirements_and_containers()
for r in requirements:
if r.type != "package":
continue
if not r.version:
lint_ctx.warn(f"Requi... | _, tool_node = _tool_xml_and_root(tool_source)
requirements, containers, resource_requirements = tool_source.parse_requirements_and_containers()
for r in requirements:
if r.type != "package":
continue
if not r.version:
lint_ctx.warn(f"Requi... | 28 | 53 | 120 | 173 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,111 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 207,209 | 206,222 | lint | RequirementVersionWhitespace | 209,222 | 209,222 | class RequirementVersionWhitespace(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class RequirementVersionWhitespace(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, tool_node = _tool_xml_and_root(tool_source)
requirements, containers, resource_requirements = tool_source.parse_requirements_and_containers()
for r in requirements:
if r.type != "package":
continue
if r.version and r.version != r.version.strip():
... | _, tool_node = _tool_xml_and_root(tool_source)
requirements, containers, resource_requirements = tool_source.parse_requirements_and_containers()
for r in requirements:
if r.type != "package":
continue
if r.version and r.version != r.version.strip():
... | 37 | 55 | 151 | 206 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,112 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 223,225 | 222,234 | lint | ResourceRequirementExpression | 225,234 | 225,234 | class ResourceRequirementExpression(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ResourceRequirementExpression(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, tool_node = _tool_xml_and_root(tool_source)
requirements, containers, resource_requirements = tool_source.parse_requirements_and_containers()
for rr in resource_requirements:
if rr.runtime_required:
lint_ctx.warn(
"Expressions in resource requir... | _, tool_node = _tool_xml_and_root(tool_source)
requirements, containers, resource_requirements = tool_source.parse_requirements_and_containers()
for rr in resource_requirements:
if rr.runtime_required:
lint_ctx.warn(
"Expressions in resource requir... | 26 | 52 | 114 | 166 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,113 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 124,126 | 123,132 | lint | ToolIDMissing | 126,132 | 126,132 | class ToolIDMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ToolIDMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, tool_node = _tool_xml_and_root(tool_source)
tool_id = tool_source.parse_id()
if not tool_id:
lint_ctx.error("Tool does not define an id attribute.", linter=cls.name(), node=tool_node)
| _, tool_node = _tool_xml_and_root(tool_source)
tool_id = tool_source.parse_id()
if not tool_id:
lint_ctx.error("Tool does not define an id attribute.", linter=cls.name(), node=tool_node)
| 19 | 51 | 80 | 131 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,114 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 144,146 | 143,152 | lint | ToolIDValid | 146,152 | 146,152 | class ToolIDValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ToolIDValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, tool_node = _tool_xml_and_root(tool_source)
tool_id = tool_source.parse_id()
if tool_id and not re.search(r"\s", tool_id):
lint_ctx.valid(f"Tool defines an id [{tool_id}].", linter=cls.name(), node=tool_node)
| _, tool_node = _tool_xml_and_root(tool_source)
tool_id = tool_source.parse_id()
if tool_id and not re.search(r"\s", tool_id):
lint_ctx.valid(f"Tool defines an id [{tool_id}].", linter=cls.name(), node=tool_node)
| 20 | 51 | 98 | 149 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,115 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 133,135 | 132,143 | lint | ToolIDWhitespace | 135,143 | 135,143 | class ToolIDWhitespace(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ToolIDWhitespace(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, tool_node = _tool_xml_and_root(tool_source)
tool_id = tool_source.parse_id()
if tool_id and re.search(r"\s", tool_id):
lint_ctx.warn(
f"Tool ID contains whitespace - this is discouraged: [{tool_id}].", linter=cls.name(), node=tool_node
)
| _, tool_node = _tool_xml_and_root(tool_source)
tool_id = tool_source.parse_id()
if tool_id and re.search(r"\s", tool_id):
lint_ctx.warn(
f"Tool ID contains whitespace - this is discouraged: [{tool_id}].", linter=cls.name(), node=tool_node
)
| 25 | 53 | 110 | 163 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,116 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 93,95 | 92,101 | lint | ToolNameMissing | 95,101 | 95,101 | class ToolNameMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ToolNameMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, tool_node = _tool_xml_and_root(tool_source)
name = tool_source.parse_name()
if not name:
lint_ctx.error("Tool name is missing or empty.", linter=cls.name(), node=tool_node)
| _, tool_node = _tool_xml_and_root(tool_source)
name = tool_source.parse_name()
if not name:
lint_ctx.error("Tool name is missing or empty.", linter=cls.name(), node=tool_node)
| 18 | 51 | 75 | 126 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,117 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 115,117 | 114,123 | lint | ToolNameValid | 117,123 | 117,123 | class ToolNameValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ToolNameValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, tool_node = _tool_xml_and_root(tool_source)
name = tool_source.parse_name()
if name and name == name.strip():
lint_ctx.valid(f"Tool defines a name [{name}].", linter=cls.name(), node=tool_node)
| _, tool_node = _tool_xml_and_root(tool_source)
name = tool_source.parse_name()
if name and name == name.strip():
lint_ctx.valid(f"Tool defines a name [{name}].", linter=cls.name(), node=tool_node)
| 20 | 51 | 84 | 135 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,118 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 102,104 | 101,114 | lint | ToolNameWhitespace | 104,114 | 104,114 | class ToolNameWhitespace(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ToolNameWhitespace(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, tool_node = _tool_xml_and_root(tool_source)
name = tool_source.parse_name()
if name and name != name.strip():
lint_ctx.warn(
f"Tool name is pre/suffixed by whitespace, this may cause errors: [{name}].",
linter=cls.name(),
node=tool_n... | _, tool_node = _tool_xml_and_root(tool_source)
name = tool_source.parse_name()
if name and name != name.strip():
lint_ctx.warn(
f"Tool name is pre/suffixed by whitespace, this may cause errors: [{name}].",
linter=cls.name(),
node=tool_n... | 28 | 53 | 110 | 163 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,119 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 153,155 | 152,162 | lint | ToolProfileInvalid | 155,162 | 155,162 | class ToolProfileInvalid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ToolProfileInvalid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, tool_node = _tool_xml_and_root(tool_source)
profile = tool_source.parse_profile()
profile_valid = PROFILE_PATTERN.match(profile) is not None
if not profile_valid:
lint_ctx.error(f"Tool specifies an invalid profile version [{profile}].", linter=cls.name(), node=tool_node)
... | _, tool_node = _tool_xml_and_root(tool_source)
profile = tool_source.parse_profile()
profile_valid = PROFILE_PATTERN.match(profile) is not None
if not profile_valid:
lint_ctx.error(f"Tool specifies an invalid profile version [{profile}].", linter=cls.name(), node=tool_node)
... | 25 | 51 | 104 | 155 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,120 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 163,165 | 162,172 | lint | ToolProfileLegacy | 165,172 | 165,172 | class ToolProfileLegacy(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ToolProfileLegacy(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, tool_node = _tool_xml_and_root(tool_source)
profile = tool_source.parse_profile()
profile_valid = PROFILE_PATTERN.match(profile) is not None
if profile_valid and Version(profile) == Version("16.01"):
lint_ctx.valid("Tool targets 16.01 Galaxy profile.", linter=cls.name(), n... | _, tool_node = _tool_xml_and_root(tool_source)
profile = tool_source.parse_profile()
profile_valid = PROFILE_PATTERN.match(profile) is not None
if profile_valid and Version(profile) == Version("16.01"):
lint_ctx.valid("Tool targets 16.01 Galaxy profile.", linter=cls.name(), n... | 26 | 52 | 115 | 167 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,121 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 173,175 | 172,182 | lint | ToolProfileValid | 175,182 | 175,182 | class ToolProfileValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ToolProfileValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | _, tool_node = _tool_xml_and_root(tool_source)
profile = tool_source.parse_profile()
profile_valid = PROFILE_PATTERN.match(profile) is not None
if profile_valid and Version(profile) != Version("16.01"):
lint_ctx.valid(f"Tool specifies profile version [{profile}].", linter=cls... | _, tool_node = _tool_xml_and_root(tool_source)
profile = tool_source.parse_profile()
profile_valid = PROFILE_PATTERN.match(profile) is not None
if profile_valid and Version(profile) != Version("16.01"):
lint_ctx.valid(f"Tool specifies profile version [{profile}].", linter=cls... | 26 | 51 | 116 | 167 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,122 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 47,49 | 42,55 | lint | ToolVersionMissing | 49,55 | 49,55 | class ToolVersionMissing(Linter):
"""
Tools must have a version
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ToolVersionMissing(Linter):
"""
Tools must have a version
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml, tool_node = _tool_xml_and_root(tool_source)
version = tool_source.parse_version() or ""
if not version:
lint_ctx.error("Tool version is missing or empty.", linter=cls.name(), node=tool_node)
| tool_xml, tool_node = _tool_xml_and_root(tool_source)
version = tool_source.parse_version() or ""
if not version:
lint_ctx.error("Tool version is missing or empty.", linter=cls.name(), node=tool_node)
| 20 | 65 | 80 | 145 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,123 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 60,62 | 55,69 | lint | ToolVersionPEP404 | 62,69 | 62,69 | class ToolVersionPEP404(Linter):
"""
Tools should have a PEP404 compliant version.
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ToolVersionPEP404(Linter):
"""
Tools should have a PEP404 compliant version.
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml, tool_node = _tool_xml_and_root(tool_source)
version = tool_source.parse_version() or ""
parsed_version = parse_version(version)
if version and isinstance(parsed_version, LegacyVersion):
lint_ctx.warn(f"Tool version [{version}] is not compliant with PEP 440.", linter... | tool_xml, tool_node = _tool_xml_and_root(tool_source)
version = tool_source.parse_version() or ""
parsed_version = parse_version(version)
if version and isinstance(parsed_version, LegacyVersion):
lint_ctx.warn(f"Tool version [{version}] is not compliant with PEP 440.", linter... | 28 | 77 | 117 | 194 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,124 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 83,85 | 82,92 | lint | ToolVersionValid | 85,92 | 85,92 | class ToolVersionValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ToolVersionValid(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml, tool_node = _tool_xml_and_root(tool_source)
version = tool_source.parse_version() or ""
parsed_version = parse_version(version)
if version and not isinstance(parsed_version, LegacyVersion) and version == version.strip():
lint_ctx.valid(f"Tool defines a version [{ver... | tool_xml, tool_node = _tool_xml_and_root(tool_source)
version = tool_source.parse_version() or ""
parsed_version = parse_version(version)
if version and not isinstance(parsed_version, LegacyVersion) and version == version.strip():
lint_ctx.valid(f"Tool defines a version [{ver... | 29 | 51 | 116 | 167 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,125 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/general.py | 70,72 | 69,82 | lint | ToolVersionWhitespace | 72,82 | 72,82 | class ToolVersionWhitespace(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ToolVersionWhitespace(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml, tool_node = _tool_xml_and_root(tool_source)
version = tool_source.parse_version() or ""
if version != version.strip():
lint_ctx.warn(
f"Tool version is pre/suffixed by whitespace, this may cause errors: [{version}].",
linter=cls.name(),
... | tool_xml, tool_node = _tool_xml_and_root(tool_source)
version = tool_source.parse_version() or ""
if version != version.strip():
lint_ctx.warn(
f"Tool version is pre/suffixed by whitespace, this may cause errors: [{version}].",
linter=cls.name(),
... | 28 | 53 | 113 | 166 | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... | """This module contains linting functions for general aspects of the tool."""
import re
from typing import (
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.biotools.source import ApiBiotoolsMetadataSource
from galaxy.tool_util.edam_util import load_edam_tree
from galaxy.t... |
46,126 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/help.py | 111,112 | 1,123 | rst_invalid | 117,123 | 112,123 | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... | invalid_rst: Union[bool, str] = False
try:
rst_to_html(text, error=True)
except Exception as e:
invalid_rst = unicodify(e)
return invalid_rst
| """
Predicate to determine if text is invalid reStructuredText.
Return False if the supplied text is valid reStructuredText or
a string indicating the problem.
"""
invalid_rst: Union[bool, str] = False
try:
rst_to_html(text, error=True)
except Exception as e:
invalid_rst ... | 17 | 1,141 | 68 | 1,209 | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... | |
46,127 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/help.py | 36,38 | 35,49 | lint | HelpEmpty | 38,49 | 38,49 | class HelpEmpty(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class HelpEmpty(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
help = tool_xml.find("./help")
if help is None:
return
help_text = help.text or ""
if not help_text.strip():
lint_ctx.warn("Help section appears to be empty.", li... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
help = tool_xml.find("./help")
if help is None:
return
help_text = help.text or ""
if not help_text.strip():
lint_ctx.warn("Help section appears to be empty.", li... | 33 | 50 | 115 | 165 | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... |
46,128 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/help.py | 78,80 | 77,94 | lint | HelpInvalidRST | 80,94 | 80,94 | class HelpInvalidRST(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class HelpInvalidRST(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
help = tool_xml.find("./help")
if help is None:
return
help_text = help.text or ""
if not help_text.strip():
return
invalid_rst = rst_invalid(help_text)
... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
help = tool_xml.find("./help")
if help is None:
return
help_text = help.text or ""
if not help_text.strip():
return
invalid_rst = rst_invalid(help_text)
... | 40 | 52 | 157 | 209 | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... |
46,129 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/help.py | 20,22 | 19,35 | lint | HelpMissing | 22,35 | 22,35 | class HelpMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class HelpMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
root = tool_xml.find("./help")
if root is None:
root = tool_xml.getroot()
help = tool_xml.find("./help")
if help is None:
lint_ctx.warn(
"No help ... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
root = tool_xml.find("./help")
if root is None:
root = tool_xml.getroot()
help = tool_xml.find("./help")
if help is None:
lint_ctx.warn(
"No help ... | 42 | 50 | 136 | 186 | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... |
46,130 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/help.py | 50,52 | 49,63 | lint | HelpPresent | 52,63 | 52,63 | class HelpPresent(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class HelpPresent(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
help = tool_xml.find("./help")
if help is None:
return
help_text = help.text or ""
if help_text.strip():
lint_ctx.valid("Tool contains help section.", linter=cls.... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
help = tool_xml.find("./help")
if help is None:
return
help_text = help.text or ""
if help_text.strip():
lint_ctx.valid("Tool contains help section.", linter=cls.... | 30 | 50 | 112 | 162 | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... |
46,131 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/help.py | 64,66 | 63,77 | lint | HelpTODO | 66,77 | 66,77 | class HelpTODO(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class HelpTODO(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
help = tool_xml.find("./help")
if help is None:
return
help_text = help.text or ""
if "TODO" in help_text:
lint_ctx.warn("Help contains TODO text.", linter=cls.na... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
help = tool_xml.find("./help")
if help is None:
return
help_text = help.text or ""
if "TODO" in help_text:
lint_ctx.warn("Help contains TODO text.", linter=cls.na... | 32 | 51 | 115 | 166 | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... |
46,132 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/help.py | 95,97 | 94,111 | lint | HelpValidRST | 97,111 | 97,111 | class HelpValidRST(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class HelpValidRST(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
help = tool_xml.find("./help")
if help is None:
return
help_text = help.text or ""
if not help_text.strip():
return
invalid_rst = rst_invalid(help_text)
... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
help = tool_xml.find("./help")
if help is None:
return
help_text = help.text or ""
if not help_text.strip():
return
invalid_rst = rst_invalid(help_text)
... | 38 | 52 | 147 | 199 | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... | """This module contains a linting function for a tool's help."""
from typing import (
TYPE_CHECKING,
Union,
)
from galaxy.tool_util.lint import Linter
from galaxy.util import (
rst_to_html,
unicodify,
)
if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.pars... |
46,134 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 1331,1333 | 1330,1351 | lint | ConditionalOptionMissing | 1333,1351 | 1333,1351 | class ConditionalOptionMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ConditionalOptionMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for conditional, conditional_name, first_param, first_param_type in _iter_conditional(tool_xml):
if first_param_type != "select":
continue
options = first_param.findall("... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for conditional, conditional_name, first_param, first_param_type in _iter_conditional(tool_xml):
if first_param_type != "select":
continue
options = first_param.findall("... | 66 | 52 | 250 | 302 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,135 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 1352,1354 | 1351,1369 | lint | ConditionalOptionMissingBoolean | 1354,1369 | 1354,1369 | class ConditionalOptionMissingBoolean(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ConditionalOptionMissingBoolean(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for conditional, conditional_name, first_param, first_param_type in _iter_conditional(tool_xml):
if first_param_type != "boolean":
continue
option_ids = {first_param.get(... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for conditional, conditional_name, first_param, first_param_type in _iter_conditional(tool_xml):
if first_param_type != "boolean":
continue
option_ids = {first_param.get(... | 58 | 53 | 239 | 292 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,136 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 1289,1291 | 1288,1306 | lint | ConditionalParamIncompatibleAttributes | 1291,1306 | 1291,1306 | class ConditionalParamIncompatibleAttributes(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ConditionalParamIncompatibleAttributes(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for _, conditional_name, first_param, first_param_type in _iter_conditional(tool_xml):
if first_param_type not in ["boolean", "select"]:
continue
for incomp in ["optional... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for _, conditional_name, first_param, first_param_type in _iter_conditional(tool_xml):
if first_param_type not in ["boolean", "select"]:
continue
for incomp in ["optional... | 42 | 54 | 186 | 240 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,137 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 1274,1276 | 1273,1288 | lint | ConditionalParamType | 1276,1288 | 1276,1288 | class ConditionalParamType(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ConditionalParamType(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for _, conditional_name, first_param, first_param_type in _iter_conditional(tool_xml):
if first_param_type not in ["boolean", "select"]:
lint_ctx.error(
f'Conditi... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for _, conditional_name, first_param, first_param_type in _iter_conditional(tool_xml):
if first_param_type not in ["boolean", "select"]:
lint_ctx.error(
f'Conditi... | 33 | 52 | 142 | 194 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,138 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 1259,1261 | 1258,1273 | lint | ConditionalParamTypeBool | 1261,1273 | 1261,1273 | class ConditionalParamTypeBool(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ConditionalParamTypeBool(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for _, conditional_name, first_param, first_param_type in _iter_conditional(tool_xml):
if first_param_type == "boolean":
lint_ctx.warn(
f'Conditional [{conditiona... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for _, conditional_name, first_param, first_param_type in _iter_conditional(tool_xml):
if first_param_type == "boolean":
lint_ctx.warn(
f'Conditional [{conditiona... | 35 | 53 | 143 | 196 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,139 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 1307,1309 | 1306,1330 | lint | ConditionalWhenMissing | 1309,1330 | 1309,1330 | class ConditionalWhenMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class ConditionalWhenMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for conditional, conditional_name, first_param, first_param_type in _iter_conditional(tool_xml):
if first_param_type not in ["boolean", "select"]:
continue
if first_param... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for conditional, conditional_name, first_param, first_param_type in _iter_conditional(tool_xml):
if first_param_type not in ["boolean", "select"]:
continue
if first_param... | 82 | 52 | 315 | 367 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,140 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 808,810 | 803,829 | lint | InputsBoolDistinctValues | 810,829 | 810,829 | class InputsBoolDistinctValues(Linter):
"""
Lint booleans for distinct true/false value
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsBoolDistinctValues(Linter):
"""
Lint booleans for distinct true/false value
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "boolean":
continue
profile = tool_source.parse_profile()
truevalue = param.... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "boolean":
continue
profile = tool_source.parse_profile()
truevalue = param.... | 60 | 74 | 249 | 323 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,141 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 834,836 | 829,861 | lint | InputsBoolProblematic | 836,861 | 836,861 | class InputsBoolProblematic(Linter):
"""
Lint booleans for problematic values, i.e. truevalue being false and vice versa
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsBoolProblematic(Linter):
"""
Lint booleans for problematic values, i.e. truevalue being false and vice versa
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "boolean":
continue
profile = tool_source.parse_profile()
truevalue = param.... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "boolean":
continue
profile = tool_source.parse_profile()
truevalue = param.... | 73 | 85 | 314 | 399 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,142 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 377,379 | 372,393 | lint | InputsDataFormat | 379,393 | 379,393 | class InputsDataFormat(Linter):
"""
Lint for data params wo format
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsDataFormat(Linter):
"""
Lint for data params wo format
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "data":
continue
if "format" not in param.attrib:
lint_ctx.warn(
... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "data":
continue
if "format" not in param.attrib:
lint_ctx.warn(
... | 42 | 69 | 150 | 219 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,143 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 420,422 | 415,438 | lint | InputsDataOptionsAttrib | 422,438 | 422,438 | class InputsDataOptionsAttrib(Linter):
"""
Lint for data params with options that have invalid attributes
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsDataOptionsAttrib(Linter):
"""
Lint for data params with options that have invalid attributes
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "data":
continue
options = param.find("./options")
if options is None:
... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "data":
continue
options = param.find("./options")
if options is None:
... | 47 | 74 | 175 | 249 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,144 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 444,446 | 438,465 | lint | InputsDataOptionsFilterAttribFiltersType | 446,465 | 446,465 | class InputsDataOptionsFilterAttribFiltersType(Linter):
"""
Lint for valid filter types for data parameters
if options set options_filter_attribute
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsDataOptionsFilterAttribFiltersType(Linter):
"""
Lint for valid filter types for data parameters
if options set options_filter_attribute
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "data":
continue
options = param.find("./options")
if options is None:
... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "data":
continue
options = param.find("./options")
if options is None:
... | 55 | 86 | 225 | 311 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,145 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 497,499 | 492,517 | lint | InputsDataOptionsFiltersRef | 499,517 | 499,517 | class InputsDataOptionsFiltersRef(Linter):
"""
Lint for set ref for filters of data parameters
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsDataOptionsFiltersRef(Linter):
"""
Lint for set ref for filters of data parameters
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "data":
continue
options = param.find("./options")
if options is None:
... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "data":
continue
options = param.find("./options")
if options is None:
... | 49 | 74 | 184 | 258 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,146 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 471,473 | 465,492 | lint | InputsDataOptionsFiltersType | 473,492 | 473,492 | class InputsDataOptionsFiltersType(Linter):
"""
Lint for valid filter types for data parameters
if options do not set options_filter_attribute
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsDataOptionsFiltersType(Linter):
"""
Lint for valid filter types for data parameters
if options do not set options_filter_attribute
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "data":
continue
options = param.find("./options")
if options is None:
... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "data":
continue
options = param.find("./options")
if options is None:
... | 64 | 85 | 259 | 344 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,147 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 398,400 | 393,415 | lint | InputsDataOptionsMultiple | 400,415 | 400,415 | class InputsDataOptionsMultiple(Linter):
"""
Lint for data params with multiple options tags
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsDataOptionsMultiple(Linter):
"""
Lint for data params with multiple options tags
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "data":
continue
options = param.findall("./options")
if len(options) > 1:
... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "data":
continue
options = param.findall("./options")
if len(options) > 1:
... | 38 | 72 | 154 | 226 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,148 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 183,185 | 178,201 | lint | InputsDatasourceTags | 185,201 | 185,201 | class InputsDatasourceTags(Linter):
"""
Lint that datasource tools have display and uihints tags
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsDatasourceTags(Linter):
"""
Lint that datasource tools have display and uihints tags
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
tool_node = tool_xml.find("./inputs")
if tool_node is None:
tool_node = tool_xml.getroot()
inputs = tool_xml.findall("./inputs//param")
if is_datasource(tool_xml):
... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
tool_node = tool_xml.find("./inputs")
if tool_node is None:
tool_node = tool_xml.getroot()
inputs = tool_xml.findall("./inputs//param")
if is_datasource(tool_xml):
... | 68 | 76 | 225 | 301 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,149 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 151,153 | 150,164 | lint | InputsMissing | 153,164 | 153,164 | class InputsMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsMissing(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
tool_node = tool_xml.find("./inputs")
if tool_node is None:
tool_node = tool_xml.getroot()
num_inputs = len(tool_xml.findall("./inputs//param"))
if num_inputs == 0 and not is... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
tool_node = tool_xml.find("./inputs")
if tool_node is None:
tool_node = tool_xml.getroot()
num_inputs = len(tool_xml.findall("./inputs//param"))
if num_inputs == 0 and not is... | 35 | 51 | 152 | 203 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,150 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 165,167 | 164,178 | lint | InputsMissingDataSource | 167,178 | 167,178 | class InputsMissingDataSource(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsMissingDataSource(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
tool_node = tool_xml.find("./inputs")
if tool_node is None:
tool_node = tool_xml.getroot()
num_inputs = len(tool_xml.findall("./inputs//param"))
if num_inputs == 0 and is_dat... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
tool_node = tool_xml.find("./inputs")
if tool_node is None:
tool_node = tool_xml.getroot()
num_inputs = len(tool_xml.findall("./inputs//param"))
if num_inputs == 0 and is_dat... | 37 | 53 | 155 | 208 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,151 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 224,226 | 219,234 | lint | InputsName | 226,234 | 226,234 | class InputsName(Linter):
"""
Lint params define a name
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsName(Linter):
"""
Lint params define a name
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param in tool_xml.findall("./inputs//param"):
if "name" not in param.attrib and "argument" not in param.attrib:
lint_ctx.error("Found param input with no name specified.", linter... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param in tool_xml.findall("./inputs//param"):
if "name" not in param.attrib and "argument" not in param.attrib:
lint_ctx.error("Found param input with no name specified.", linter... | 32 | 66 | 111 | 177 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,152 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 310,312 | 305,326 | lint | InputsNameDuplicate | 312,326 | 312,326 | class InputsNameDuplicate(Linter):
"""
Lint params with duplicate names
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsNameDuplicate(Linter):
"""
Lint params with duplicate names
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
input_names = set()
for param, param_name in _iter_param(tool_xml):
# check for parameters with duplicate names
path = _param_path(param, param_name)
if path in input... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
input_names = set()
for param, param_name in _iter_param(tool_xml):
# check for parameters with duplicate names
path = _param_path(param, param_name)
if path in input... | 46 | 68 | 156 | 224 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,153 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 331,333 | 326,351 | lint | InputsNameDuplicateOutput | 333,351 | 333,351 | class InputsNameDuplicateOutput(Linter):
"""
Lint params names that are also used in outputs
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsNameDuplicateOutput(Linter):
"""
Lint params names that are also used in outputs
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
input_names = set()
for param, param_name in _iter_param(tool_xml):
input_names.add(_param_path(param, param_name))
# check if there is an output with the same name as an input
... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
input_names = set()
for param, param_name in _iter_param(tool_xml):
input_names.add(_param_path(param, param_name))
# check if there is an output with the same name as an input
... | 63 | 73 | 206 | 279 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,154 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 261,263 | 256,271 | lint | InputsNameEmpty | 263,271 | 263,271 | class InputsNameEmpty(Linter):
"""
Lint params define a non-empty name
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsNameEmpty(Linter):
"""
Lint params define a non-empty name
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name in _iter_param(tool_xml):
if param_name.strip() == "":
lint_ctx.error("Param input with empty name.", linter=cls.name(), node=param)
| tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name in _iter_param(tool_xml):
if param_name.strip() == "":
lint_ctx.error("Param input with empty name.", linter=cls.name(), node=param)
| 25 | 70 | 97 | 167 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,155 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 239,241 | 234,256 | lint | InputsNameRedundantArgument | 241,256 | 241,256 | class InputsNameRedundantArgument(Linter):
"""
Lint params define a name
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsNameRedundantArgument(Linter):
"""
Lint params define a name
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param in tool_xml.findall("./inputs//param"):
if "name" in param.attrib and "argument" in param.attrib:
param_name = _parse_name(param.attrib.get("name"), param.attrib.get("argum... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param in tool_xml.findall("./inputs//param"):
if "name" in param.attrib and "argument" in param.attrib:
param_name = _parse_name(param.attrib.get("name"), param.attrib.get("argum... | 52 | 70 | 210 | 280 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,156 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 276,278 | 271,288 | lint | InputsNameValid | 278,288 | 278,288 | class InputsNameValid(Linter):
"""
Lint params define valid cheetah placeholder
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsNameValid(Linter):
"""
Lint params define valid cheetah placeholder
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name in _iter_param(tool_xml):
if param_name != "" and not is_valid_cheetah_placeholder(param_name):
lint_ctx.warn(
f"Param input [{param_name}] ... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name in _iter_param(tool_xml):
if param_name != "" and not is_valid_cheetah_placeholder(param_name):
lint_ctx.warn(
f"Param input [{param_name}] ... | 34 | 70 | 130 | 200 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,157 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 137,139 | 136,150 | lint | InputsNum | 139,150 | 139,150 | class InputsNum(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsNum(Linter):
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
tool_node = tool_xml.find("./inputs")
if tool_node is None:
tool_node = tool_xml.getroot()
num_inputs = len(tool_xml.findall("./inputs//param"))
if num_inputs:
li... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
tool_node = tool_xml.find("./inputs")
if tool_node is None:
tool_node = tool_xml.getroot()
num_inputs = len(tool_xml.findall("./inputs//param"))
if num_inputs:
li... | 30 | 51 | 146 | 197 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,158 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 522,524 | 517,539 | lint | InputsSelectDynamicOptions | 524,539 | 524,539 | class InputsSelectDynamicOptions(Linter):
"""
Lint for select with deprecated dynamic_options attribute
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsSelectDynamicOptions(Linter):
"""
Lint for select with deprecated dynamic_options attribute
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "select":
continue
dynamic_options = param.get("dynamic_options", None)
if d... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type != "select":
continue
dynamic_options = param.get("dynamic_options", None)
if d... | 40 | 73 | 161 | 234 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,159 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 889,891 | 884,908 | lint | InputsSelectMandatoryCheckboxes | 891,908 | 891,908 | class InputsSelectMandatoryCheckboxes(Linter):
"""
Lint selects that are mandatory but display as checkboxes
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsSelectMandatoryCheckboxes(Linter):
"""
Lint selects that are mandatory but display as checkboxes
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type not in ["select", "data_column", "drill_down"]:
continue
multiple = string_as_bool(param.at... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type not in ["select", "data_column", "drill_down"]:
continue
multiple = string_as_bool(param.at... | 53 | 79 | 232 | 311 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
46,160 | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy | /home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/tool_util/linters/inputs.py | 913,915 | 908,931 | lint | InputsSelectMultipleRadio | 915,931 | 915,931 | class InputsSelectMultipleRadio(Linter):
"""
Lint selects that allow only multiple selections but display as radio
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | class InputsSelectMultipleRadio(Linter):
"""
Lint selects that allow only multiple selections but display as radio
"""
@classmethod
def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
FILL_FUNC_BODY | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type not in ["select", "data_column", "drill_down"]:
continue
multiple = string_as_bool(param.at... | tool_xml = getattr(tool_source, "xml_tree", None)
if not tool_xml:
return
for param, param_name, param_type in _iter_param_type(tool_xml):
if param_type not in ["select", "data_column", "drill_down"]:
continue
multiple = string_as_bool(param.at... | 44 | 78 | 196 | 274 | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... | """This module contains a linting functions for tool inputs."""
import ast
import re
import warnings
from typing import (
Iterator,
Optional,
Tuple,
TYPE_CHECKING,
)
from packaging.version import Version
from galaxy.tool_util.lint import Linter
from galaxy.util import string_as_bool
from ._util impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.