diff --git a/.github/ISSUE_TEMPLATE/code_optimisation.yml b/.github/ISSUE_TEMPLATE/code_optimisation.yml new file mode 100644 index 0000000..3e4c155 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/code_optimisation.yml @@ -0,0 +1,65 @@ +name: Code Optimisation Request 🚀 +description: Request a code optimisation change +title: "[OPTIMISATION]: " +labels: ["enhancement", "optimisation"] +# projects: [] +# assignees: ["vihar-s1"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this code optimisation request! 🤗 + + - type: textarea + id: optimisation-description + attributes: + label: Brief Description of Optimisation + description: Tell us about the optimisation you are proposing. | + Use code snippets and examples where necessary to assist explanation. + placeholder: Describe the optimisation you want to propose. + validations: + required: true + + - type: textarea + id: current-implementation + attributes: + label: Current Implementation + description: Provide details of the current implementation that you think can be optimized. | + Use code snippets and examples where necessary to assist explanation. + placeholder: Describe the current implementation. + validations: + required: true + + - type: textarea + id: proposed-implementation + attributes: + label: Proposed Implementation + description: Provide details of the proposed implementation. | + Use code snippets and examples where necessary to assist explanation. + placeholder: Describe the proposed implementation. + validations: + required: true + + - type: textarea + id: benefits + attributes: + label: Benefits of Optimisation + description: Explain the benefits of the proposed optimisation. | + Use metrics and examples where necessary to assist explanation. + placeholder: Describe the benefits of the proposed optimisation. + validations: + required: true + + - type: checkboxes + id: checks + attributes: + label: Check-List + description: Please make sure to check the following milestones before submitting the optimisation request! + options: + - label: I have checked that a similar kind of optimisation request does not already exist! + required: true + - label: I have tested the proposed optimisation and it works as expected. + required: true + - label: I have read the [Contributing Guidelines](https://github.com/vihar-s1/Desktop-Assistant/blob/main/CONTRIBUTING.md) + required: true + - label: I want to work on implementing the optimisation! \ No newline at end of file diff --git a/shell.sh b/shell.sh new file mode 100644 index 0000000..ff1d603 --- /dev/null +++ b/shell.sh @@ -0,0 +1,41 @@ +# Get the list of changed files and calculate the total pylint score for them + +# Setup the project and activate the virtual environment +bash setupProject.sh +source .venv/bin/activate +echo "Active Virtual Environment: ${VIRTUAL_ENV}" + +# get the list of installed python modules +pip freeze + +# Get the list of changed files +changes="" + +# Make sure to include only the files that exist +changed_files="" +for file in $changes; do + if [ -f "$file" ]; then + changed_files="$changed_files $file" + fi +done +echo "Changed existing files: $changed_files" + +# Check if there are any changed Python files +if [ -z "$changed_files" ]; then + echo "No Python files changed." + exit 0 +fi + +# Run pylint on the changed files and capture the score +{ # try + pylint_score=$(pylint $changed_files | grep 'Your code has been rated at' | awk '{print $7}' | cut -d '/' -f 1) +} || { # catch + echo "Pylint failed to run with exit code: $?" +} +# Check if the score is below 9 +if (( $(echo "$pylint_score < 9" | bc -l) )); then + echo "Pylint score is below 9: $pylint_score" + exit 1 +else + echo "Pylint score is acceptable: $pylint_score" +fi \ No newline at end of file