question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix `use-set-literal` lint errors

See original GitHub issue

Fix use-set-literal lint errors by following the instructions below (example PR: #6534):

https://github.com/mlflow/mlflow/blob/1b89add428da0a4453e7523a20d13f04f6291f37/pylint_plugins/set_checker.py#L12-L41

What needs to be fixed?

set applied on list or tuple literal need to be converted to set literal:

# Bad
set([1, 2, 3])
set((1, 2, 3))

# Good
{1, 2, 3}

Files

File Assignee PR
mlflow/azure/client.py @Monkero #6544
mlflow/entities/lifecycle_stage.py @Monkero #6544
mlflow/entities/run_status.py @Monkero #6544
mlflow/server/handlers.py @dsgibbons #6542
mlflow/tracking/fluent.py @dsgibbons #6542
mlflow/utils/autologging_utils/safety.py @dsgibbons #6542
tests/autologging/test_autologging_behaviors_unit.py @dsgibbons #6543
tests/entities/test_run_info.py @dsgibbons #6543
tests/entities/test_run_status.py @dsgibbons #6543
tests/lightgbm/test_lightgbm_autolog.py @iamthen0ise #6560
tests/models/test_model_input_examples.py @iamthen0ise #6560
tests/projects/test_project_spec.py @iamthen0ise #6560
tests/pyfunc/test_model_export_with_loader_module_and_data_path.py @dsgibbons #6584
tests/store/artifact/test_databricks_artifact_repo.py @dsgibbons #6584
tests/store/artifact/test_ftp_artifact_repo.py @dsgibbons #6584
~tests/tensorflow/test_tensorflow2_autolog.py~ - -
tests/utils/test_requirements_utils.py @dsgibbons #6584
tests/xgboost/test_xgboost_autolog.py @dsgibbons #6584
mlflow/utils/search_utils.py @harupy #6534
tests/entities/model_registry/test_model_version.py @harupy #6534
tests/entities/model_registry/test_registered_model.py @harupy #6534
tests/store/tracking/test_sqlalchemy_store.py @harupy #6534
tests/tracking/test_model_registry.py @harupy #6534

If you’re interested in working on this issue, ping me with the file you would like to work on. Please fix only 1 ~ 3 items per pull request.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
harupycommented, Aug 25, 2022

@dsgibbons @iamthen0ise @Monkero Thanks for working on this issue! We have more good-first issues. Please let me know if you’re interested in working on them 😃

1reaction
harupycommented, Aug 24, 2022

@dsgibbons Thanks! When you file a PR, can you remove the IGNORED_FILES variable?

diff --git a/pylint_plugins/set_checker.py b/pylint_plugins/set_checker.py
index 0a7f1d483..b646ef37e 100644
--- a/pylint_plugins/set_checker.py
+++ b/pylint_plugins/set_checker.py
@@ -5,30 +5,6 @@ from pylint.interfaces import IAstroidChecker
 from pylint.checkers import BaseChecker
 
 
-IGNORED_FILES = set(
-    map(
-        os.path.abspath,
-        [
-            ##### Instructions #####
-            # 1. Select the file you would like to work on.
-            # 2. Remove the file from the list.
-            # 3. Run `pylint <the file>`.
-            # 4. Fix lint errors.
-            # 5. File a PR.
-            "tests/lightgbm/test_lightgbm_autolog.py",
-            "tests/models/test_model_input_examples.py",
-            "tests/projects/test_project_spec.py",
-            "tests/pyfunc/test_model_export_with_loader_module_and_data_path.py",
-            "tests/store/artifact/test_databricks_artifact_repo.py",
-            "tests/store/artifact/test_ftp_artifact_repo.py",
-            "tests/tensorflow/test_tensorflow2_autolog.py",
-            "tests/utils/test_requirements_utils.py",
-            "tests/xgboost/test_xgboost_autolog.py",
-        ],
-    )
-)
-
-
 class SetChecker(BaseChecker):
     __implements__ = IAstroidChecker
 
@@ -45,8 +21,6 @@ class SetChecker(BaseChecker):
     priority = -1
 
     def visit_call(self, node: astroid.Call):
-        if node.root().file in IGNORED_FILES:
-            return
         if (
             node.func.as_string() == "set"
             and node.args
Read more comments on GitHub >

github_iconTop Results From Across the Web

Automatically fix lint problems only on a specific file
I am running npm run lint -- --fix from command line to automatically fix lint errors, but this command creates fixes on the...
Read more >
VS Code tips — Quickly fix all linter errors in a file ... - YouTube
Today's VS Code extension tip: ESLint fix all actions Quickly fix all linter problems for a given ESLint rule or fix all auto...
Read more >
fix lint errors · Issue #2245 · cloudfoundry/cli - GitHub
I created a local branch and fixed the errors. Do you want a PR? What happened. I ran "make", which runs the lint...
Read more >
Command Line Interface - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Don't just lint your code - fix it with Prettier - freeCodeCamp
Linters are powerful and provide an easy way to scan your code for syntax errors that could lead to bugs. Or they can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found