Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 154 Prompt User to Install Code Linters for each Detected Language #332

Merged
merged 10 commits into from
Nov 14, 2023

Conversation

kevin-orlando
Copy link
Contributor

@kevin-orlando kevin-orlando commented Nov 9, 2023

closes #154

Overview

Adds functionality to prompt the user to determine if linter based pre-commit hooks should be added to the code repository. The user will be prompted for each detected language during init.

An example messages will be Add lint pre-commit(s) for JavaScript? [Y/n]

adding the --yes option will bypass the prompting to install linter pre-commit hooks and will automatically add them.

Technical Approach

This pr includes reorganizing the pre-commit templates into a new folder/file structure. Templates will be located under resources/pre-commit and will be split into separate folders and files based on if they are linter hooks or not. The user responses and code will determine whether or not the hooks should be combined and saved to the user's repository. Splitting these files out ensures a simple way of knowing which hooks are linters.

Testing

  1. run secureli init
  2. follow flow to add/ignore linters for each detected language
  3. Verify pre-commit linters are added or not added to pre-commit.yaml depending on prompt response

Regression testing:
Testing scan and update to ensure both are working as normal.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR title failed to match (chore|style|test|feat|fix|docs): .+

@kevin-orlando kevin-orlando changed the title Feature/secureli 154 prompt to install linters feat: 154 Prompt User to Install Code Linters for each Detected Language Nov 9, 2023
@github-actions github-actions bot dismissed their stale review November 9, 2023 19:32

All good!

@kevin-orlando kevin-orlando marked this pull request as ready for review November 9, 2023 22:15
Copy link
Contributor

@tdurk93 tdurk93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With my as-yet limited knowledge of Secureli, I think looks good but I left some minor comments.

secureli/services/language_config.py Outdated Show resolved Hide resolved
secureli/services/language_config.py Outdated Show resolved Hide resolved
secureli/services/language_support.py Outdated Show resolved Hide resolved
secureli/services/language_support.py Outdated Show resolved Hide resolved
tests/services/test_language_config.py Outdated Show resolved Hide resolved
@kevin-orlando kevin-orlando merged commit c63860f into main Nov 14, 2023
3 checks passed
@kevin-orlando kevin-orlando deleted the feature/secureli-154-prompt-to-install-linters branch November 14, 2023 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prompt user to choose which languages to install linters for
4 participants