Repository: iterative/dvc

Issue:
gc: unused arguments
Might be a bug https://github.com/iterative/dvc/pull/2029#issuecomment-494268568


Discussion:
We have many arguments in many functions and methods, which might be not used. It could be beneficial adding `pylint` or other tool to check it to our pipeline. 
@Suor Yes, we've been planning to enable pylint as a forced check along black and flake8 for a long time now, but just didn't have time to go through the code base and clean everything up(e.g. with docstring checks disabled for now, since fixing those is too much hustle).

Resolving patch:
diff --git a/dvc/repo/__init__.py b/dvc/repo/__init__.py
--- a/dvc/repo/__init__.py
+++ b/dvc/repo/__init__.py
@@ -164,7 +164,7 @@ def collect(self, target, with_deps=False, recursive=False):
         from dvc.stage import Stage
 
         if not target or (recursive and os.path.isdir(target)):
-            return self.active_stages(target)
+            return self.stages(target)
 
         stage = Stage.load(self, target)
         if not with_deps:
@@ -183,7 +183,6 @@ def used_cache(
         self,
         targets=None,
         all_branches=False,
-        active=True,
         with_deps=False,
         all_tags=False,
         remote=None,
@@ -225,20 +224,10 @@ def used_cache(
                         stages.extend(
                             self.collect(target, with_deps=with_deps)
                         )
-            elif active:
-                stages = self.active_stages()
             else:
                 stages = self.stages()
 
             for stage in stages:
-                if active and not targets and stage.locked:
-                    logger.warning(
-                        "DVC-file '{path}' is locked. Its dependencies are"
-                        " not going to be pushed/pulled/fetched.".format(
-                            path=stage.relpath
-                        )
-                    )
-
                 for out in stage.outs:
                     scheme = out.path_info.scheme
                     used_cache = out.get_used_cache(
@@ -413,14 +402,6 @@ def stages(self, from_directory=None, check_dag=True):
 
         return stages
 
-    def active_stages(self, from_directory=None):
-        import networkx as nx
-
-        stages = []
-        for G in self.pipelines(from_directory):
-            stages.extend(list(nx.get_node_attributes(G, "stage").values()))
-        return stages
-
     def find_outs_by_path(self, path, outs=None, recursive=False):
         if not outs:
             # there is no `from_directory=path` argument because some data
diff --git a/dvc/repo/gc.py b/dvc/repo/gc.py
--- a/dvc/repo/gc.py
+++ b/dvc/repo/gc.py
@@ -21,9 +21,7 @@ def _merge_cache_lists(clists):
 
 def _load_all_used_cache(
     repos,
-    target=None,
     all_branches=False,
-    active=True,
     with_deps=False,
     all_tags=False,
     remote=None,
@@ -37,7 +35,6 @@ def _load_all_used_cache(
             repo_clist = repo.used_cache(
                 targets=None,
                 all_branches=all_branches,
-                active=False,
                 with_deps=with_deps,
                 all_tags=all_tags,
                 remote=remote,
@@ -76,9 +73,7 @@ def gc(
 
     all_clists = _load_all_used_cache(
         all_repos,
-        target=None,
         all_branches=all_branches,
-        active=False,
         with_deps=with_deps,
         all_tags=all_tags,
         remote=remote,


Test patch: