-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/secureli 436 language detection (#481)
secureli-436 <!-- Include general description here --> closes #436 Adds focused language detection during scan for specified or committed files ## Changes <!-- A detailed list of changes --> * Limiting language detection to a specified set of files during scan (unless all files is provided) * Adding the usage of git.Repo to check the commit file diff ## Testing <!-- Mention updated tests and any manual testing performed. Are aspects not yet tested or not easily testable? Feel free to include screenshots if appropriate. --> * Verify that language detection can be run on either specified or committed files during scan ## Clean Code Checklist <!-- This is here to support you. Some/most checkboxes may not apply to your change --> - [x] Meets acceptance criteria for issue - [x] New logic is covered with automated tests - [x] Appropriate exception handling added - [x] Thoughtful logging included - [x] Documentation is updated - [x] Follow-up work is documented in TODOs - [x] TODOs have a ticket associated with them - [x] No commented-out code included <!-- Github-flavored markdown reference: https://docs.github.com/en/get-started/writing-on-github --> --------- Co-authored-by: Jordan Heffernan <[email protected]>
- Loading branch information
1 parent
029a597
commit fbd983d
Showing
11 changed files
with
251 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from abc import ABC, abstractmethod | ||
import git | ||
|
||
|
||
class RepoAbstraction(ABC): | ||
""" | ||
Abstracts the configuring and execution of git repo features. | ||
""" | ||
|
||
@abstractmethod | ||
def get_commit_diff(self) -> list[str]: | ||
pass | ||
|
||
|
||
class GitRepo(RepoAbstraction): | ||
""" | ||
Implementation and wrapper around git repo features | ||
""" | ||
|
||
def get_commit_diff(self) -> list[str]: | ||
return git.Repo().head.commit.diff() |
Oops, something went wrong.