Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Commit-Analysis-ML
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ahmad, Rawel
Commit-Analysis-ML
Commits
bf646a56
Commit
bf646a56
authored
1 year ago
by
Ahmad, Rawel
Browse files
Options
Downloads
Patches
Plain Diff
added check if commit should be none to prevent errors
parent
d658a2b1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Classifier/commit_features.py
+9
-0
9 additions, 0 deletions
Classifier/commit_features.py
with
9 additions
and
0 deletions
Classifier/commit_features.py
+
9
−
0
View file @
bf646a56
...
...
@@ -66,6 +66,10 @@ class CommitFeatures:
return
commit
def
save_features_to_json
(
self
,
path
):
if
self
.
commit
is
None
:
print
(
f
"
Could not extract features, commit with SHA=
{
self
.
commit_sha
}
not found
"
)
return
if
not
os
.
path
.
exists
(
path
):
os
.
makedirs
(
path
)
...
...
@@ -82,6 +86,11 @@ class CommitFeatures:
def
extract_features
(
self
):
"""
Extracts features from a commit
"""
if
self
.
commit
is
None
:
print
(
f
"
Could not extract features, commit with SHA=
{
self
.
commit_sha
}
not found
"
)
return
# load repo
self
.
features_raw
[
"
repo
"
]
=
self
.
repo_path
.
split
(
"
/
"
)[
-
1
]
self
.
features_raw
[
"
hash
"
]
=
str
(
self
.
commit_sha
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment