Skip to content

Commit

Permalink
feat: #64 kotlin language linter support (#363)
Browse files Browse the repository at this point in the history
- Adds support for Kotlin linting.
- Updated script to support 2 or 3 digit story numbers.

Closes [#64](#64)

AC's confirmed:

1. Pre-commit hooks are configured and config is stored in the repo
under /.secureli/config when a Kotlin repo is detected.

<img width="1071" alt="image"
src="https://github.com/slalombuild/secureli/assets/127901972/54dc1a9a-f483-4a77-b082-9b64d6ce1ff0">

<img width="613" alt="image"
src="https://github.com/slalombuild/secureli/assets/127901972/a325e2c4-e22c-41fb-a4ed-089b03bb5c5c">

<img width="599" alt="image"
src="https://github.com/slalombuild/secureli/assets/127901972/ea3b92aa-9a63-4d40-815e-59cdc51b4a62">

  
2. If there are any failing linting issues, per the list above, when a
commit is attempted the commit is blocked and an error with details is
displayed to the user.

<img width="1341" alt="image"
src="https://github.com/slalombuild/secureli/assets/127901972/cbde31d4-6c1a-4a11-adda-ebc999d6d28b">


3.  Readme & internal help is updated with supporting language info:
(See updated contributing.md file)
  • Loading branch information
isaac-heist-slalom authored Jan 20, 2024
1 parent 41f89a5 commit 9427cef
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ seCureLI has Slalom-maintained templates for security management of the followin
- C#
- Swift
- Golang
- Kotlin

## Python 3.9.9

Expand Down
2 changes: 1 addition & 1 deletion scripts/get-current-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ else
fi

# Check if short name work
if [[ $branch == "main" || $branch =~ ^secureli[0-9][0-9][0-9]$ || $branch =~ "dependabot" ]]; then
if [[ $branch == "main" || $branch =~ ^secureli[0-9]+$ || $branch =~ "dependabot" ]]; then
echo "The branch name is a valid pattern."
else
echo "error The branch name ${branch} does not meet naming requirements. It should look something like feature/secureli-123-mybranchname."
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repos:
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/quwac/pre-commit-detekt
rev: v1.23.4
hooks:
- id: detekt
1 change: 1 addition & 0 deletions secureli/services/language_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"JavaScript",
"Go",
"Swift",
"Kotlin",
]


Expand Down

0 comments on commit 9427cef

Please sign in to comment.