Skip to content

Tioborto/raddar

Repository files navigation

Raddar

Quality Gate Status python version pre-commit Code style: black Checked with detect-secrets Conventional Commits

Requirements

  • Python 3.8+. You can use pyenv to install multiple versions of Python in parallel.

Development

Prerequisites

An env file is required to use analyses via GitHub webhook.

  1. cp .env_template .env
  2. Set variables in .env file

Local

To start the API, follow these instructions:

  1. git clone https://github.com/tioborto/raddar.git
  2. cd raddar
  3. Create and activate virtualenv (eg. poetry shell)
  4. Install the requirements for both prod and dev: poetry install
  5. Run uvicorn raddar.main:app (--reload for development)
  6. Install git hooks: pre-commit install --install-hooks

Docker image

A Dockerfile and a docker-compose file are present in this repository.
To launch the app using docker, just follow these instructions :

$ docker-compose build
$ docker-compose up -d

To check the logs, run:

docker-compose logs

The API will be accessible at the same URLs as above.

Access

In local mode or using the docker image, a mini web server is launched in your terminal session and the API is accessible at the following URLs:

Code formatting

Code formatting is automated using Black. Simply run black . to format your code.

Precommit hooks

Before every commit, pre-commit hooks are run to:

  • check code formatting
  • detect secrets
  • create TOC in README

If your commit is prevented by black, that means that code was reformatted. Just try your commit again and it should pass.

If it was prevented by markdown-toc, that means the TOC was regenerated. git add the modified README and commit again.

Contributing

Please open a Pull Request per User Story, with a commit per subtask, or a Pull Request per subtask.

Please try to follow Conventional Commits for your commits, e.g:

  • feat: list GitHub users OK
  • fix: use new Vault authentication in GitLab CI OK
  • fix : stuff NOT OK (space before colon + vague message)
  • change: list GitHub users NOT OK (change keyword not in allowed list)
  • feat: List GitHub users NOT OK (message should not start with a capital letter, e.g not List)
  • more examples are available in the Conventional Commits documentation

Allowed keywords for commits are build, ci, chore, docs, feat, fix, perf, refactor, revert, style, test.

You can use commitizen to help you choose the type of commit and write your messages.

Please test your code, and make sure that code coverage doesn't decrease.

Please type hint your code, or add types to the code you change.

License

Raddar is available under the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published