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
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DESKTOP_ASSISTANT_SMTP_PWD=YOUR_EMAIL_PASSWORD
SMTP_PASSWORD=YOUR_EMAIL_PASSWORD
2 changes: 1 addition & 1 deletion .github/workflows/pylint-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

# 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)
pylint_score=$(pylint --rcfile pylintrc $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: $?"
}
Expand Down
33 changes: 28 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,35 @@ Welcome to the open-source Voice-Assisted Desktop Assistant project! Contributio
```

5. **_Make Changes:_** Work on the issue you're assigned to or the feature you want to add. Make sure to test your changes.
- Any new command added should be implemented via a function in the `commands.py` file.
- Any additional functionality should be added in the `infra.py` file.
- DO NOT DEFINE ANY GLOBAL VARIABLES IN THE `infra.py` or `commands.py`. Define a class variable inside `__init__(self)` method of `Assistant` class if you have to.
- All the functions implemented in the `infra.py` and `commnds.py` file should be python equivalent of _static_ methods.
- Any new command added should be implemented via a class defined in the `commands` directory.
- Any additional generic utility should be added in the `infra.py` file.
- DO NOT DEFINE ANY GLOBAL VARIABLES IN THE `infra.py`. Define a class variable inside `__init__(self)` method of `Assistant` class if you have to.
- All the functions implemented in the `infra.py` file should be python equivalent of _static_ methods.

6. **_Run the Pre-commit hooks:_** The pre-commit hooks are set up to ensure that the code is formatted correctly and passes the linting checks. They are already set up in the project and configured via the `.pre-commit-config.yaml` file. To run the pre-commit hooks, use the following command:
```
# class structure
- static methods
- commandName
- No arguements
- the `__name__` field of class as return value
- validate_query
- Single argument - query
- Validates query and returns true if query is a match for the action
- execute_query
- Two arguments - query and voice-interface instance
- executes the query and announces the result via the voice interface instance
```

6. **_Registering Command:_** Once the command is implemented, register the command in the `command_registery.py` file via the `register_command(command_name, validate_query, execute_query)` method of the `CommandRegistery` class.

7. **_Requirements:_** If you are adding any new libraries or dependencies, make sure to update the `requirements.txt` file. To generate the updated `requirements.txt` file, run the following command:

```bash
pipdeptree --warn silence | grep -E '^[a-zA-Z0-9]' | sed 's/==/~=/g' > requirements.txt
```
- The above command will generate the `requirements.txt` file with the appropriate versions of the libraries used in the project without the nested depedencies and metadata.

8. **_Run the Pre-commit hooks:_** The pre-commit hooks are set up to ensure that the code is formatted correctly and passes the linting checks. They are already set up in the project and configured via the `.pre-commit-config.yaml` file. To run the pre-commit hooks, use the following command:
```bash
pre-commit run --all-files
```
Expand Down
17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,11 @@ A simple Python-based desktop assistant that can perform basic tasks like search
## 🚀 Introduction

- The project is a simple Python-based desktop assistant that can perform basic tasks like searching on Google, opening applications, telling the time, and more.
- The assistant is still in the development phase, and more features will be added in the future.
- The assistant is built using Python and does not use any Machine Learning (ML) or Artificial Intelligence (AI) models.
- The assistant is always under the development phase waiting for more features to be added.
- It is built using Python and does not use any Machine Learning (ML) or Artificial Intelligence (AI) models.
- The assistant is built using the `pyttsx3` library for text-to-speech conversion and the `speech_recognition` library for speech recognition.
- The project is open-source and contributions and/or feature requests are always welcome.

## ✨ Features

- Google and Wikipedia searches 🌐
- Open applications and websites 🚀
- Tell time of the day in _hour **:** minute **:** second_ format ⏰
- Scroll the screen up and down, left and right. 📜

## 🚀 Getting Started

To get started with the project, follow the instructions below.
Expand Down Expand Up @@ -106,14 +99,14 @@ objc.super(NSSpeechDriver, self).init()
## 🤝 Contributing

- If you want to contribute, follow the contribution guidelines
here: [Contributing Guidelines](https://github.com/vihar-s1/Desktop-Assistant/blob/main/CONTRIBUTING.md).
here: [Contributing Guidelines](CONTRIBUTING.md).

## 🐞 Bug Reports and Feature Requests

- If you encounter an issue or want to report a bug, following is
the [Bug Report Template](https://github.com/vihar-s1/Desktop-Assistant/blob/main/.github/ISSUE_TEMPLATE/bug_report.md)
the [Bug Report Template](.github/ISSUE_TEMPLATE/bug_report.yml)
you will be asked to follow.
- Any new feature requests will also be appreciated if it follows the predefined [Feature Request Template](https://github.com/vihar-s1/Desktop-Assistant/blob/main/.github/ISSUE_TEMPLATE/feature_request.md).
- Any new feature requests will also be appreciated if it follows the predefined [Feature Request Template](.github/ISSUE_TEMPLATE/feature_request.yml).

> **NOTE:** The templates are predefined and integrated in the repository so you can go to
> the [Issues Tab](https://github.com/vihar-s1/Desktop-Assistant/issues) and start writing your bug report, or feature
Expand Down
41 changes: 41 additions & 0 deletions pylint-score-check.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

# Get the list of changed files
{ # try
changes=$(git diff --name-only HEAD main | grep '\.py$')
} || { # catch
if [ $? -eq 1 ]; then
echo "No python file changes found in the pull request."
exit 0
fi
}

echo -e "changes:\n$changes\n"
# 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 -e "Changed existing files:\n$changed_files\n"

# 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
Loading
Loading