Skip to content

Commit

Permalink
Added grammar check into CI (#242)
Browse files Browse the repository at this point in the history
* Added grammar check into CI
- removed redundant docker-compose install in CI

* fixed build

* moved check into separarte job

* fixed all typos

Thanks @introkun!
  • Loading branch information
introkun authored Mar 30, 2024
1 parent bc3c9af commit 32fb9fa
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 22 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/check_typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Check Typos
on:
push:
branches:
- main
pull_request:

jobs:
check-typos:
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.*" ]

runs-on: ${{ matrix.os }}

steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

#----------------------------------------------
# check grammar with typos
#----------------------------------------------
- name: Check grammar with typos
run: |
pip3 install typos
typos
10 changes: 0 additions & 10 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@ jobs:
virtualenvs-in-project: false
installer-parallel: true

#----------------------------------------------
# install docker compose
# setup + configure docker compose
#----------------------------------------------
- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
#----------------------------------------------
# copy docker compose file
#----------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[files]
extend-exclude = ["**/bundle.js", "**/bundle.js.map"]
2 changes: 1 addition & 1 deletion backend/api/invoices/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def receive_scheduled_invoice(request: HttpRequest):
valid, reason, status = authenticate_api_key(request)

if not valid:
print(f"[BACKEND] ERROR recieving scheduled invoice: {reason}", flush=True)
print(f"[BACKEND] ERROR receiving scheduled invoice: {reason}", flush=True)
return HttpResponse(reason, status=status)

invoice_id = request.POST.get("invoice_id") or request.headers.get("invoice_id")
Expand Down
2 changes: 1 addition & 1 deletion backend/views/core/clients/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def validate_client_create(client_details):
if len(client_details.get("name")) < 3:
return "Client name must be at least 3 characters"

if client_details.get("is_representiative") and not client_details.get("company"):
if client_details.get("is_representative") and not client_details.get("company"):
return "Please provide a company name if you are creating a representative"

return None
2 changes: 1 addition & 1 deletion docs/getting-setup/databases/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This is the name of your database that you created. You will have to do this man
- First access your db

```bash
$ mysql -h {DATABASE_HOST} -u {DATABSE_USER} -p {DATABASE_PASS} # manually fill out the values in brackets {}
$ mysql -h {DATABASE_HOST} -u {DATABASE_USER} -p {DATABASE_PASS} # manually fill out the values in brackets {}
```

- Then run this SQL command:
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-setup/databases/postgres.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This is the name of your database that you created. You will have to do this man
- First access your db

```bash
$ psql -h {DATABASE_HOST} -U {DATABSE_USER} -p {DATABASE_PORT} # manually fill out the values in brackets {}
$ psql -h {DATABASE_HOST} -U {DATABASE_USER} -p {DATABASE_PORT} # manually fill out the values in brackets {}
```

- Then run this SQL command:
Expand Down
2 changes: 1 addition & 1 deletion documentation/markdown.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
To use markdown santiation to HTML we can use the newly installed django-markdownify tool.
To use markdown sanitation to HTML we can use the newly installed django-markdownify tool.

```html
{% load markdownify %}
Expand Down
2 changes: 1 addition & 1 deletion frontend/static/js/charts-lines.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ const lineConfig = {
},
}

// change this to the id of your chart element in HMTL
// change this to the id of your chart element in HTML
const lineCtx = document.getElementById('line')
window.myLine = new Chart(lineCtx, lineConfig)
2 changes: 1 addition & 1 deletion frontend/static/js/charts-pie.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ const pieConfig = {
},
}

// change this to the id of your chart element in HMTL
// change this to the id of your chart element in HTML
const pieCtx = document.getElementById('pie')
window.myPie = new Chart(pieCtx, pieConfig)
4 changes: 2 additions & 2 deletions frontend/templates/base/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
drawer.addEventListener("change", function () {
if (drawer.checked) {
document.getElementById("service_list_toggler").checked = true;
document.getElementById("logo_single_serivce_list_toggler").checked = true;
document.getElementById("logo_single_service_list_toggler").checked = true;
} else {
document.getElementById("service_list_toggler").checked = false;
document.getElementById("logo_single_serivce_list_toggler").checked = false;
document.getElementById("logo_single_service_list_toggler").checked = false;
}
;
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/templates/base/topbar/_topbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
id="service_list_button"
aria-label="close sidebar"
class="swap-rotate drawer-overlay swap flex items-center">
<input type="checkbox" id="logo_single_serivce_list_toggler" />
<input type="checkbox" id="logo_single_service_list_toggler" />
<img src="{% static "img/logo_single.png" %}" class="h-10 swap-off">
<i class="absolute fa fa-solid fa-x swap-on flex justify-center items-center"></i>
</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{% component "pages:invoices:dashboard:payment_status_badge" status=invoice.payment_status inv_id=invoice.id %}
</td>
<td colspan="2">
{# The if statement for dropdown top goes as followes #}
{# The if statement for dropdown top goes as follows #}
{# Use dropdown on top if these: #}
{# - is second to last item (and not first item) #}
{# - is last item (and not first item) #}
Expand Down
21 changes: 20 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ redis = { extras = ["hiredis"], version = "^5.0.1" }
boto3-stubs = { extras = ["sesv2", "events", "scheduler", "iam", "stepfunctions"], version = "^1.34.54" }
djangorestframework = "^3.14.0"
django-tz-detect = "^0.4.0"
typos = "^1.19.0"

[tool.poetry.group.django.dependencies]
Django = "^5.0.2"
Expand Down

0 comments on commit 32fb9fa

Please sign in to comment.