we're thrilled to have you contribute to safetext! your efforts help enhance a powerful tool for content moderation.
- create a folder: make a new folder in the
languagesdirectory with the ISO 639-1 code of the language (e.g.,frfor French). - add
words.txt: in this folder, add awords.txtfile containing a list of profanity words/phrases, one per line.
- improve a language's
words.txtby adding new words or refining the list by removing false positives.
- use the discussions section for bug reports, feature requests and any questions.
- share your feedback or suggestions to help us improve.
# quick setup
git clone https://github.com/viddexa/safetext.git
cd safetext
# Unix/Linux/macOS
./scripts/setup.sh # installs uv and dependencies
./scripts/run_tests.sh # run tests
# Windows
scripts\setup.bat # checks uv and installs dependencies
scripts\run_tests.bat # run tests
# or manual setup (all platforms)
# install uv from https://github.com/astral-sh/uv
uv sync --extra dev
# run tests (after setup, the venv is activated automatically)
./scripts/run_tests.sh # Unix/Linux/macOS
scripts\run_tests.bat # Windows
# or manually
source .venv/bin/activate # Unix/Linux/macOS
# or
.venv\Scripts\activate # Windows
pytest -n auto
# before committing - fix code style issues
ruff check --fix .
ruff format .
# if ruff fails, it will show you what needs to be fixed!
### important notes
- **always use `uv sync`**, never `uv pip install` for dependencies
- **always activate venv** before running python commands:
```bash
source .venv/bin/activate # Unix/Linux/macOS
.venv\Scripts\activate # Windows- never use
uv run pytest, usepytestafter activating venv
### using pip (traditional)
```bash
# clone and setup
git clone https://github.com/viddexa/safetext.git
cd safetext
# create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# install
pip install -e ".[dev]"
# run tests with parallel execution
pytest -n auto
# before committing
ruff check --fix . && ruff format .
- ruff errors: If
ruff checkfails, read the error messages carefully. They tell you exactly what needs to be fixed. Runruff check --fix .to automatically fix most issues. - formatting issues: Run
ruff format .to automatically format your code according to project standards. - test failures: Run
pytest -vfor verbose output to see which tests are failing and why.
We provide convenient test scripts with different options:
# Unix/Linux/macOS
./scripts/run_tests.sh quick # fast tests only (default)
./scripts/run_tests.sh full # all tests including slow ones
./scripts/run_tests.sh coverage # generate coverage report
./scripts/run_tests.sh lint # run only linting checks
./scripts/run_tests.sh all # linting + all tests
# Windows
scripts\run_tests.bat quick # same options as above
scripts\run_tests.bat full
scripts\run_tests.bat coverage
scripts\run_tests.bat lint
scripts\run_tests.bat all💡 tip: use quick during development for fast feedback, and all before committing!
- fork the repo: click 'Fork' on GitHub to copy the repository.
- create a branch: make a branch in your fork, e.g.,
add-spanish. - make changes: update or add files.
- test your changes: run
./scripts/run_tests.sh all(orscripts\run_tests.bat allon Windows) - commit: commit your changes with a clear message.
- push: upload your changes to your Github fork.
- open a PR: go to the original
safetextrepository, click 'New Pull Request', pick your branch, then submit it with a clear description of your changes.
Contributions are under the MIT License.