Narsil HF staff commited on
Commit
3092d65
1 Parent(s): b5f15bd

Remove filter.

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -57,8 +57,7 @@ def default_repo():
57
 
58
 
59
 
60
- def check_repo(repo_path, since, mincount):
61
- repo_path = args.repo
62
  most_common = 10
63
  bugwords = [("revert", 1), ("bug", 1), ("fix", 1)]
64
 
@@ -67,7 +66,7 @@ def check_repo(repo_path, since, mincount):
67
  git = Git()
68
  commits = []
69
  for commit in repo.iter_commits():
70
- if args.since and commit.committed_datetime < args.since.astimezone():
71
  break
72
  commits.append(commit.hexsha[:6])
73
 
@@ -97,9 +96,9 @@ def check_repo(repo_path, since, mincount):
97
  current_commit += 1
98
  else:
99
  found = True
100
- if args.filter:
101
  found = False
102
- for filter_ in args.filter:
103
  if filter_ in line:
104
  found = True
105
  break
@@ -131,7 +130,7 @@ def check_repo(repo_path, since, mincount):
131
  string += "Most commonly bugged files (adjusted)" + "\n"
132
  adjusted = {}
133
  for (filename, count) in bugfiles.items():
134
- if count < args.mincount:
135
  continue
136
  percentage = count / files[filename]
137
  adjusted[filename] = (percentage, count)
 
57
 
58
 
59
 
60
+ def check_repo(repo_path, since, mincount, filter_=None):
 
61
  most_common = 10
62
  bugwords = [("revert", 1), ("bug", 1), ("fix", 1)]
63
 
 
66
  git = Git()
67
  commits = []
68
  for commit in repo.iter_commits():
69
+ if since and commit.committed_datetime < since.astimezone():
70
  break
71
  commits.append(commit.hexsha[:6])
72
 
 
96
  current_commit += 1
97
  else:
98
  found = True
99
+ if filter_:
100
  found = False
101
+ for filter_ in filter_:
102
  if filter_ in line:
103
  found = True
104
  break
 
130
  string += "Most commonly bugged files (adjusted)" + "\n"
131
  adjusted = {}
132
  for (filename, count) in bugfiles.items():
133
+ if count < mincount:
134
  continue
135
  percentage = count / files[filename]
136
  adjusted[filename] = (percentage, count)