Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue984/switch to pylint #986

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open

Issue984/switch to pylint #986

wants to merge 11 commits into from

Conversation

Leahh02
Copy link
Collaborator

@Leahh02 Leahh02 commented Jan 9, 2025

This PR fixes issue #984.

pyproject.toml and setup.cfg have been updated, and pylama.yml has been changed to pylint.yml. I chose pylint 3.2.7 because it supports python >= 3.8 and our current python version is >=3.8.3,<=3.13.0. All of the other recent pylint releases support python >= 3.9.

This PR will be compared with the one I'll make switching to Ruff so we can decide which one to switch to.

@Leahh02 Leahh02 added the WIP (lint-only) Only run the linter in CI, nothing else label Jan 9, 2025
@Leahh02
Copy link
Collaborator Author

Leahh02 commented Jan 13, 2025

Message controls for specific lines and for entire files

For pylama we have some lines where we want to skip linting. We do this by having # noqa at the end of the line. pylint does not follow the same syntax. To skip message codes on a line add # pylint: disable=message_code or # pylint: disable=message_name to the end of the line. For example, to disable R0916 add # pylint: disable=R0916 or # pylint: disable=too-many-boolean-expressions to the end of the line. To skip all of the messages from a category on a specific line add # pylint: disable=category_code. For example, to skip all the refactoring related codes for a line add # pylint: disable=R to the end. We'll have to change the current # noqa lines to the pylint equivalent. There might also be # noqa lines that don't have a pylint error, so we can just remove that.

In addition to skipping specific lines, we also have specific message codes skipped for an entire file. We're doing this in pylama by adding # pylama:ignore=message_code at the bottom of the file. For example, we have # pylama:ignore=W0511,R1732 at the bottom of bee_client.py. The pylint equivalent of this is adding # pylint: disable=message_code or # pylint: disable=message_name at the top of the file. We can also skip an entire category for a file by adding # pylint: disable=category_code at the top. These disable lines must be at the top of the file -- this is different from pylama and ruff where they can be at the bottom or the top (see note about this in PR #987).

Here's documentation about disabling messages in pylint: https://pylint.pycqa.org/en/latest/user_guide/messages/message_control.html

@Leahh02
Copy link
Collaborator Author

Leahh02 commented Jan 14, 2025

************* Module common.api
beeflow/common/api.py:10:27: W0613: Unused argument 'e' (unused-argument)
************* Module common.connection
beeflow/common/connection.py:30:31: E1101: Instance of 'LookupDict' has no 'okay' member (no-member)
************* Module common.integration_test
beeflow/common/integration_test.py:297:0: C0301: Line too long (100/99) (line-too-long)
************* Module common.config_driver
beeflow/common/config_driver.py:6:0: W0012: Unknown option value for 'disable', expected a valid pylint message and got 'C901' (unknown-option-value)
beeflow/common/config_driver.py:363:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)
beeflow/common/config_driver.py:134:19: E1136: Value 'cls.CONFIG' is unsubscriptable (unsubscriptable-object)
************* Module common.wf_data
beeflow/common/wf_data.py:6:0: W0012: Unknown option value for 'disable', expected a valid pylint message and got 'C901' (unknown-option-value)
************* Module common.build_interfaces
beeflow/common/build_interfaces.py:11:0: W0012: Unknown option value for 'disable', expected a valid pylint message and got 'C901' (unknown-option-value)
************* Module common.db.client_db
beeflow/common/db/client_db.py:13:8: C0103: Attribute name "Info" doesn't conform to snake_case naming style (invalid-name)
************* Module common.db.wfm_db
beeflow/common/db/wfm_db.py:13:0: C0301: Line too long (143/99) (line-too-long)
beeflow/common/db/wfm_db.py:13:8: C0103: Attribute name "Info" doesn't conform to snake_case naming style (invalid-name)
beeflow/common/db/wfm_db.py:66:8: C0103: Attribute name "Task" doesn't conform to snake_case naming style (invalid-name)
beeflow/common/db/wfm_db.py:68:8: C0103: Attribute name "Workflow" doesn't conform to snake_case naming style (invalid-name)
************* Module common.db.tm_db
beeflow/common/db/tm_db.py:19:8: C0103: Attribute name "Job" doesn't conform to snake_case naming style (invalid-name)
beeflow/common/db/tm_db.py:65:8: C0103: Attribute name "Job" doesn't conform to snake_case naming style (invalid-name)
************* Module common.worker.worker
beeflow/common/worker/worker.py:47:49: E0606: Possibly using variable 'crt_driver' before assignment (possibly-used-before-assignment)
************* Module common.worker.lsf_worker
beeflow/common/worker/lsf_worker.py:43:12: W0719: Raising too general exception: Exception (broad-exception-raised)
************* Module common.worker.slurm_worker
beeflow/common/worker/slurm_worker.py:140:0: C0301: Line too long (133/99) (line-too-long)
beeflow/common/worker/slurm_worker.py:140:14: W1510: 'subprocess.run' used without explicitly defining the value for 'check'. (subprocess-run-check)
************* Module common.worker.flux_worker
beeflow/common/worker/flux_worker.py:37:8: C0415: Import outside toplevel (flux) (import-outside-toplevel)
beeflow/common/worker/flux_worker.py:38:8: C0415: Import outside toplevel (flux.job) (import-outside-toplevel)
************* Module common.gdb.neo4j_cypher
beeflow/common/gdb/neo4j_cypher.py:14:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)
************* Module common.gdb.neo4j_driver
beeflow/common/gdb/neo4j_driver.py:45:27: E1120: No value for argument 'cls' in classmethod call (no-value-for-parameter)
beeflow/common/gdb/neo4j_driver.py:64:12: W0201: Attribute '_driver' defined outside __init__ (attribute-defined-outside-init)
************* Module common.deps.container_manager
beeflow/common/deps/container_manager.py:11:0: C0411: third party import "celery.shared_task" should be placed before first party imports "beeflow.common.config_driver.BeeConfig", "beeflow.common.paths"  (wrong-import-order)
beeflow/common/deps/container_manager.py:11:0: W0611: Unused shared_task imported from celery (unused-import)
************* Module common.deps.neo4j_manager
beeflow/common/deps/neo4j_manager.py:148:15: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
************* Module common.build.container_drivers
beeflow/common/build/container_drivers.py:6:0: C0301: Line too long (100/99) (line-too-long)
beeflow/common/build/container_drivers.py:71:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)
beeflow/common/build/container_drivers.py:78:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)
beeflow/common/build/container_drivers.py:258:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)
************* Module common.cloud.chameleoncloud
beeflow/common/cloud/chameleoncloud.py:22:30: W0613: Unused argument 'node_name' (unused-argument)
************* Module common.cloud.google
beeflow/common/cloud/google.py:37:0: C0301: Line too long (107/99) (line-too-long)
************* Module common.parser.parser
beeflow/common/parser/parser.py:355:30: W1309: Using an f-string that does not have any interpolated variables (f-string-without-interpolation)
beeflow/common/parser/parser.py:361:30: W1309: Using an f-string that does not have any interpolated variables (f-string-without-interpolation)
************* Module common.crt.charliecloud_driver
beeflow/common/crt/charliecloud_driver.py:151:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)
beeflow/common/crt/charliecloud_driver.py:45:4: R0915: Too many statements (59/50) (too-many-statements)
************* Module wf_manager.wf_manager
beeflow/wf_manager/wf_manager.py:6:0: W0611: Unused shared_task imported from celery (unused-import)
************* Module wf_manager.resources.wf_actions
beeflow/wf_manager/resources/wf_actions.py:85:15: E0606: Possibly using variable 'resp' before assignment (possibly-used-before-assignment)
************* Module wf_manager.resources.wf_update
beeflow/wf_manager/resources/wf_update.py:86:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens)
************* Module wf_manager.resources.wf_utils
beeflow/wf_manager/resources/wf_utils.py:189:11: E0606: Possibly using variable 'url' before assignment (possibly-used-before-assignment)
beeflow/wf_manager/resources/wf_utils.py:194:34: W0613: Unused argument 'allocation' (unused-argument)
beeflow/wf_manager/resources/wf_utils.py:268:35: W0613: Unused argument 'wf_dir' (unused-argument)
beeflow/wf_manager/resources/wf_utils.py:19:0: C0411: third party import "celery.shared_task" should be placed before first party imports "beeflow.common.log", "beeflow.common.config_driver.BeeConfig", "beeflow.common.gdb.neo4j_driver" (...) "beeflow.common.paths", "beeflow.common.db.wfm_db", "beeflow.common.db.bdb.connect_db"  (wrong-import-order)
beeflow/wf_manager/resources/wf_utils.py:19:0: W0611: Unused shared_task imported from celery (unused-import)
************* Module task_manager.task_actions
beeflow/task_manager/task_actions.py:27:19: W0718: Catching too general exception Exception (broad-exception-caught)
************* Module task_manager.background
beeflow/task_manager/background.py:45:11: W0718: Catching too general exception Exception (broad-exception-caught)
************* Module data.cwl.cwl_validation.ml-workflow.machine_learning.predict_code
beeflow/data/cwl/cwl_validation/ml-workflow/machine_learning/predict_code.py:4:0: W0012: Unknown option value for 'disable', expected a valid pylint message and got 'C0501' (unknown-option-value)
************* Module tests.mocks
beeflow/tests/mocks.py:106:19: C0303: Trailing whitespace (trailing-whitespace)
beeflow/tests/mocks.py:35:29: W0613: Unused argument 'wf_id' (unused-argument)
beeflow/tests/mocks.py:39:34: W0613: Unused argument 'task' (unused-argument)
beeflow/tests/mocks.py:51:29: W0613: Unused argument 'task_id' (unused-argument)
beeflow/tests/mocks.py:79:34: W0613: Unused argument 'wf_id' (unused-argument)
beeflow/tests/mocks.py:79:41: W0613: Unused argument 'wf_name' (unused-argument)
beeflow/tests/mocks.py:79:50: W0613: Unused argument 'inputs' (unused-argument)
beeflow/tests/mocks.py:79:58: W0613: Unused argument 'outputs' (unused-argument)
beeflow/tests/mocks.py:79:67: W0613: Unused argument 'req' (unused-argument)
beeflow/tests/mocks.py:79:77: W0613: Unused argument 'hints' (unused-argument)
beeflow/tests/mocks.py:100:29: W0613: Unused argument 'task_name' (unused-argument)
beeflow/tests/mocks.py:106:8: W0107: Unnecessary pass statement (unnecessary-pass)
beeflow/tests/mocks.py:110:8: W0107: Unnecessary pass statement (unnecessary-pass)
beeflow/tests/mocks.py:149:31: W0613: Unused argument 'workflow_id' (unused-argument)
beeflow/tests/mocks.py:156:29: W0613: Unused argument 'workflow_id' (unused-argument)
beeflow/tests/mocks.py:160:30: W0613: Unused argument 'workflow_id' (unused-argument)
beeflow/tests/mocks.py:164:29: W0613: Unused argument 'old_id' (unused-argument)
beeflow/tests/mocks.py:185:37: W0613: Unused argument 'workflow_id' (unused-argument)
beeflow/tests/mocks.py:204:39: W0613: Unused argument 'workflow_id' (unused-argument)
beeflow/tests/mocks.py:208:33: W0613: Unused argument 'workflow_id' (unused-argument)
beeflow/tests/mocks.py:212:33: W0613: Unused argument 'workflow_id' (unused-argument)
beeflow/tests/mocks.py:216:33: W0613: Unused argument 'workflow_id' (unused-argument)
beeflow/tests/mocks.py:220:50: W0613: Unused argument 'workflow_id' (unused-argument)
beeflow/tests/mocks.py:224:30: W0613: Unused argument 'workflow_id' (unused-argument)
beeflow/tests/mocks.py:257:12: W0104: Statement seems to have no effect (pointless-statement)
beeflow/tests/mocks.py:296:33: W0613: Unused argument 'workflow_id' (unused-argument)
beeflow/tests/mocks.py:306:4: W0107: Unnecessary pass statement (unnecessary-pass)
beeflow/tests/mocks.py:316:29: W0613: Unused argument 'wf_id' (unused-argument)
beeflow/tests/mocks.py:316:36: W0613: Unused argument 'cwl_path' (unused-argument)
beeflow/tests/mocks.py:316:46: W0613: Unused argument 'yaml_file' (unused-argument)
beeflow/tests/mocks.py:324:26: W0613: Unused argument 'task' (unused-argument)
beeflow/tests/mocks.py:328:25: W0613: Unused argument 'job_id' (unused-argument)
beeflow/tests/mocks.py:332:26: W0613: Unused argument 'job_id' (unused-argument)
beeflow/tests/mocks.py:340:26: W0613: Unused argument 'task' (unused-argument)
beeflow/tests/mocks.py:344:25: W0613: Unused argument 'job_id' (unused-argument)
beeflow/tests/mocks.py:348:26: W0613: Unused argument 'job_id' (unused-argument)
beeflow/tests/mocks.py:366:13: W0613: Unused argument 'url' (unused-argument)
beeflow/tests/mocks.py:366:18: W0613: Unused argument 'params' (unused-argument)
beeflow/tests/mocks.py:366:0: W0613: Unused argument 'kwargs' (unused-argument)
beeflow/tests/mocks.py:371:14: W0613: Unused argument 'url' (unused-argument)
beeflow/tests/mocks.py:371:19: W0613: Unused argument 'params' (unused-argument)
beeflow/tests/mocks.py:371:0: W0613: Unused argument 'kwargs' (unused-argument)
beeflow/tests/mocks.py:376:13: W0613: Unused argument 'url' (unused-argument)
beeflow/tests/mocks.py:376:18: W0613: Unused argument 'params' (unused-argument)
beeflow/tests/mocks.py:376:0: W0613: Unused argument 'kwargs' (unused-argument)
beeflow/tests/mocks.py:381:16: W0613: Unused argument 'url' (unused-argument)
beeflow/tests/mocks.py:381:21: W0613: Unused argument 'params' (unused-argument)
beeflow/tests/mocks.py:381:0: W0613: Unused argument 'kwargs' (unused-argument)
************* Module tests.test_config_validator
beeflow/tests/test_config_validator.py:12:0: C0301: Line too long (111/99) (line-too-long)
************* Module tests.test_parser
beeflow/tests/test_parser.py:41:0: C0301: Line too long (105/99) (line-too-long)
beeflow/tests/test_parser.py:42:0: C0301: Line too long (107/99) (line-too-long)
beeflow/tests/test_parser.py:55:0: C0301: Line too long (108/99) (line-too-long)
beeflow/tests/test_parser.py:56:0: C0301: Line too long (110/99) (line-too-long)
beeflow/tests/test_parser.py:75:0: C0301: Line too long (130/99) (line-too-long)
beeflow/tests/test_parser.py:167:0: C0301: Line too long (546/99) (line-too-long)
beeflow/tests/test_parser.py:168:0: C0301: Line too long (181/99) (line-too-long)
beeflow/tests/test_parser.py:197:0: C0301: Line too long (548/99) (line-too-long)
beeflow/tests/test_parser.py:226:0: C0301: Line too long (546/99) (line-too-long)
beeflow/tests/test_parser.py:227:0: C0301: Line too long (163/99) (line-too-long)
beeflow/tests/test_parser.py:256:0: C0301: Line too long (548/99) (line-too-long)
beeflow/tests/test_parser.py:285:0: C0301: Line too long (548/99) (line-too-long)
beeflow/tests/test_parser.py:314:0: C0301: Line too long (548/99) (line-too-long)
beeflow/tests/test_parser.py:365:0: C0301: Line too long (142/99) (line-too-long)
************* Module tests.test_slurm_worker
beeflow/tests/test_slurm_worker.py:9:0: W0012: Unknown option value for 'disable', expected a valid pylint message and got 'E402' (unknown-option-value)
************* Module tests.test_wf_interface
beeflow/tests/test_wf_interface.py:6:0: W0012: Unknown option value for 'disable', expected a valid pylint message and got 'E402' (unknown-option-value)
************* Module tests.test_tm
beeflow/tests/test_tm.py:46:21: W0621: Redefining name 'flask_client' from outer scope (line 19) (redefined-outer-name)
beeflow/tests/test_tm.py:46:43: W0621: Redefining name 'temp_db' from outer scope (line 37) (redefined-outer-name)
beeflow/tests/test_tm.py:81:24: W0621: Redefining name 'flask_client' from outer scope (line 19) (redefined-outer-name)
beeflow/tests/test_tm.py:81:46: W0621: Redefining name 'temp_db' from outer scope (line 37) (redefined-outer-name)
beeflow/tests/test_tm.py:81:24: W0613: Unused argument 'flask_client' (unused-argument)
beeflow/tests/test_tm.py:97:21: W0621: Redefining name 'flask_client' from outer scope (line 19) (redefined-outer-name)
beeflow/tests/test_tm.py:97:43: W0621: Redefining name 'temp_db' from outer scope (line 37) (redefined-outer-name)
************* Module scheduler.algorithms
beeflow/scheduler/algorithms.py:244:9: W0613: Unused argument 'algorithm' (unused-argument)
************* Module scheduler.scheduler
beeflow/scheduler/scheduler.py:55:12: W0613: Unused argument 'workflow_name' (unused-argument)
beeflow/scheduler/scheduler.py:99:34: E1101: Instance of 'Namespace' has no 'alloc_logfile' member (no-member)
beeflow/scheduler/scheduler.py:102:28: E1101: Instance of 'Namespace' has no 'workdir' member (no-member)
beeflow/scheduler/scheduler.py:118:16: E1101: Instance of 'Namespace' has no 'workdir' member (no-member)
************* Module client.bee_client
beeflow/client/bee_client.py:112:0: C0301: Line too long (100/99) (line-too-long)
beeflow/client/bee_client.py:42:0: C0103: Constant name "short_id_len" doesn't conform to UPPER_CASE naming style (invalid-name)
beeflow/client/bee_client.py:112:0: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
beeflow/client/bee_client.py:326:38: E0606: Possibly using variable 'workflow' before assignment (possibly-used-before-assignment)
beeflow/client/bee_client.py:331:28: E0606: Possibly using variable 'wf_tarball' before assignment (possibly-used-before-assignment)
beeflow/client/bee_client.py:641:51: E0606: Possibly using variable 'wf_tarball' before assignment (possibly-used-before-assignment)
beeflow/client/bee_client.py:645:27: E1101: Instance of 'LookupDict' has no 'created' member (no-member)
************* Module client.core
beeflow/client/core.py:114:8: C0206: Consider iterating with .items() (consider-using-dict-items)
beeflow/client/core.py:257:17: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
beeflow/client/core.py:279:8: C0415: Import outside toplevel (env_modules_python.module) (import-outside-toplevel)
beeflow/client/core.py:319:12: C0415: Import outside toplevel (flux) (import-outside-toplevel)
beeflow/client/core.py:319:12: W0611: Unused import flux (unused-import)
beeflow/client/core.py:373:25: W0613: Unused argument 'signum' (unused-argument)
beeflow/client/core.py:373:33: W0613: Unused argument 'stack' (unused-argument)
************* Module remote.remote
beeflow/remote/remote.py:1:0: R0801: Similar lines in 2 files
==data.cwl.bee_workflows.pennant-build.graph_pennant:[10:44]
==data.dockerfiles.pennant-graph.graph_pennant:[10:44]
results = []
for fname in sys.argv[1:]:
    pe_count = 0
    times = []
    with open(fname, encoding='utf-8') as fp:
        for line in fp:
            # Check for the PE count
            m_pe_count = re.match(r'Running on (\d+) MPI PE\(s\)', line)
            if m_pe_count:
                pe_count = int(m_pe_count.group(1))
                continue
            # Check for an End cyle line
            if not line.startswith('End cycle'):
                continue
            _, _, _, wall = line.split(',')
            _, time = wall.split('=')
            time = float(time.strip())
            times.append(time)
    results.append({
        'pe_count': pe_count,
        'average_wall_time': sum(times) / len(times),
    })

# The node counts
x = [str(result['pe_count']) for result in results]
# Average wall for cycle
y = [result['average_wall_time'] for result in results]
fig, ax = plt.subplots()
ax.plot(x, y)
ax.set_title('PENNANT Workflow Run')
ax.set_xlabel('Node count')
ax.set_ylabel('Average wall time for cycle')
# Save to a png file
fig.savefig('graph.png') (duplicate-code)
beeflow/remote/remote.py:1:0: R0801: Similar lines in 2 files
==common.db.bdb:[65:80]
==wf_manager.common.wf_db:[48:63]
        try:
            cursor = conn.cursor()
            if params:
                cursor.execute(stmt, params)
            else:
                cursor.execute(stmt)
            result = cursor.fetchall()
        except Error:
            result = None
    return result


def table_exists(db_file, table_name):
    """Return true if a table exists and false if not."""
    stmt = f"SELECT name FROM sqlite_master WHERE type='table' AND name='{table_name}';" (duplicate-code)
beeflow/remote/remote.py:1:0: R0801: Similar lines in 2 files
==common.db.wfm_db:[171:181]
==wf_manager.common.wf_db:[105:115]
                        FOREIGN KEY (workflow_id)
                            REFERENCES workflows (workflow_id)
                                ON DELETE CASCADE
                                ON UPDATE NO ACTION);"""

        info_stmt = """CREATE TABLE IF NOT EXISTS info (
                           id INTEGER PRIMARY KEY,
                           wfm_port INTEGER,
                           tm_port INTEGER,
                           sched_port INTEGER, (duplicate-code)
beeflow/remote/remote.py:1:0: R0801: Similar lines in 2 files
==common.db.bdb:[36:49]
==wf_manager.common.wf_db:[34:47]
        try:
            cursor = conn.cursor()
            if params:
                cursor.execute(stmt, params)
            else:
                cursor.execute(stmt)
            conn.commit()
        except Error as error:
            print(error)


def getone(db_file, stmt, params=None):
    """Run the sql statement on the database and return the result.""" (duplicate-code)
beeflow/remote/remote.py:1:0: R0801: Similar lines in 2 files
==common.worker.flux_worker:[69:79]
==common.worker.slurm_worker:[62:71]
        scripts_enabled = task.get_requirement('beeflow:ScriptRequirement', 'enabled',
                                               default=False)
        if scripts_enabled:
            # We use StringIO here to properly break the script up into lines with readlines
            pre_script = io.StringIO(task.get_requirement('beeflow:ScriptRequirement',
                                     'pre_script')).readlines()
            post_script = io.StringIO(task.get_requirement('beeflow:ScriptRequirement',
                                      'post_script')).readlines()

        # Pre commands (duplicate-code)
beeflow/remote/remote.py:1:0: R0801: Similar lines in 2 files
==common.db.bdb:[14:25]
==wf_manager.common.wf_db:[12:23]
    conn = None
    try:
        conn = sqlite3.connect(db_file)
        return conn
    except Error as error:
        print(error)
    return conn


def create_table(db_file, stmt):
    """Create a new table in the database.""" (duplicate-code)
beeflow/remote/remote.py:1:0: R0801: Similar lines in 2 files
==data.cwl.cwl_validation.ml-workflow.machine_learning.decision_tree:[20:28]
==data.cwl.cwl_validation.ml-workflow.machine_learning.linear_regression:[16:24]
    X = pickle.load(open('/home/bee/cwl2/MyX.p', 'rb'))
    Y = pickle.load(open('/home/bee/cwl2/MyY.p', 'rb'))

    X = X.values

    print("My pickle X is", X)
    Y = Y.values
    print("My pickle Y is", Y) (duplicate-code)
beeflow/remote/remote.py:1:0: R0801: Similar lines in 2 files
==common.worker.lsf_worker:[30:39]
==common.worker.slurm_worker:[129:139]
        task_text = self.build_text(task)

        task_script = f'{self.task_save_path(task)}/{task.name}-{task.id}.sh'
        with open(task_script, 'w', encoding='UTF-8') as script_f:
            script_f.write(task_text)
            script_f.close()
        return task_script

    def submit_job(self, script):
        """Worker submits job-returns (job_id, job_state).""" (duplicate-code)
beeflow/remote/remote.py:1:0: R0801: Similar lines in 2 files
==common.db.bdb:[50:56]
==wf_manager.common.wf_db:[34:40]
        try:
            cursor = conn.cursor()
            if params:
                cursor.execute(stmt, params)
            else:
                cursor.execute(stmt) (duplicate-code)
beeflow/remote/remote.py:1:0: R0801: Similar lines in 2 files
==common.db.bdb:[36:42]
==wf_manager.common.wf_db:[48:54]
        try:
            cursor = conn.cursor()
            if params:
                cursor.execute(stmt, params)
            else:
                cursor.execute(stmt) (duplicate-code)
beeflow/remote/remote.py:1:0: R0801: Similar lines in 2 files
==common.db.wfm_db:[153:158]
==wf_manager.common.wf_db:[86:91]
    workflows_stmt = """CREATE TABLE IF NOT EXISTS workflows (
                            id INTEGER PRIMARY KEY,
                            -- Set workflow ID to unique.
                            workflow_id INTEGER UNIQUE,
                            name TEXT, (duplicate-code)
beeflow/remote/remote.py:1:0: R0801: Similar lines in 2 files
==common.db.bdb:[26:35]
==wf_manager.common.wf_db:[24:33]
        try:
            cursor = conn.cursor()
            cursor.execute(stmt)
        except Error as error:
            print(error)


def run(db_file, stmt, params=None):
    """Run the sql statement on the database. Doesn't return anything.""" (duplicate-code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP (lint-only) Only run the linter in CI, nothing else
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant