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

chore: Added spellcheck action and dev instructions #16

Merged
merged 2 commits into from
Sep 6, 2024
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
18 changes: 18 additions & 0 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Spell Check

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
spellcheck:
name: Spell Check
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4

- name: Check spelling
uses: crate-ci/typos@master
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ To build the Docker image locally:
1. Ensure you have Docker installed on your machine.
2. Navigate to the project root directory in your terminal.
3. Build the Docker image:
```
```bash
docker build -t hxckr-core:local .
```

### Running the Docker Container

To run the Docker container:

```
```bash
docker run -p 8080:80 -e DATABASE_URL=postgres://real_username:real_password@real_host/real_db hxckr-core:local
```

Expand All @@ -104,3 +104,29 @@ This project uses GitHub Actions to automatically publish Docker images to Docke
4. Update the GitHub Actions workflow file (`.github/workflows/docker-publish.yml`) with your DockerHub repository name.

The workflow will build and push a new Docker image on each push to the main branch and when a new release is created.

## Development

### Spell Checking

To maintain consistent spelling across the project, we use the [`typos crate`](https://github.com/crate-ci/typos) for spell checking. Follow these steps to run the spell check locally:

1. Ensure you are in the nix shell.

2. Install the typos crate:

```bash
cargo install typos-cli
```

3. Run the spell check from the root of the project:

```bash
typos
```

4. If there are any spelling issues, typos will output them to the console.

5. Fix any misspellings in your code, or add project-specific terms to the `[default.extend-words]` list in [typos.toml](./typos.toml) if they are correct for this project.

Note: Running this check locally before committing can help catch spelling errors early and keep the GitHub Actions checks passing.
5 changes: 5 additions & 0 deletions typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[default.extend-words]
hxckr="hxckr"

[files]
extend-exclude = ["postgres_data", "target", "migrations", "cargo.lock", "cargo.toml"]