Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/ISSUE_TEMPLATE/code_optimisation.yml
Original file line number Diff line number Diff line change
@@ -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!
41 changes: 41 additions & 0 deletions shell.sh
Original file line number Diff line number Diff line change
@@ -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