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

Remove python version from black #286

Merged
merged 4 commits into from
Apr 4, 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
7 changes: 1 addition & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ repos:
rev: 23.11.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.12

# isort
- repo: https://github.com/pycqa/isort
Expand Down Expand Up @@ -39,7 +34,7 @@ repos:

# prettier
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v3.1.0'
rev: v3.1.0
hooks:
- id: prettier
types: [javascript]
17 changes: 12 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Some Common Ways to Contribute
# Contribution Guide

## Add a new page
## Pre-Commit

We have a `.pre-commit-config.yaml` file in our repository that will help you avoid common linting/formatting mistakes when you commit your changes. You can get set up by following
pre-commit's [quick start guide](https://pre-commit.com/#quick-start).

## Some Common Ways to Contribute

### Add a new page

The official Flask documentation contains a useful [walkthrough](https://flask.palletsprojects.com/en/3.0.x/quickstart/#rendering-templates) of how to add/modify a new web view.

Expand Down Expand Up @@ -48,7 +55,7 @@ You will be able to see your page by running your Flask server and visiting `<UR
Our templates are contained within `dashboard/src/t5gweb/templates` and our endpoints are
defined in `dashboard/src/t5gweb/ui.py`.

## Alter JavaScript
### Alter JavaScript

We are using a framework called [DataTables](https://datatables.net/) to add interactive tables to our dashboard. The majority of our JavaScript is related to these tables:

Expand Down Expand Up @@ -98,7 +105,7 @@ And that's it, we can now filter our table by "Case Status":

The DataTables [documentation](https://datatables.net) is very extensive, and can help you find and make any other changes that you might think of.

## Adding tests
### Adding tests

We use [pytest](https://docs.pytest.org/en/8.0.x/) for our unit tests. Pytest's docs are very helpful, but here's a simple example to get started:

Expand Down Expand Up @@ -178,7 +185,7 @@ In this case, the API call will not take place, and will instead be represented

Our unit tests are located in `tests/`, and we run tests automatically for PR's and commits on the `main` branch via GitHub Actions (`.github/workflows/linter.yml`). You can run tests locally by installing pytest and pytest-mock, and then running `pytest` from the root directory of the repository (`t5g-field-support-team-utils/`).

## Add a new scheduled task
### Add a new scheduled task

We use [Celery beat](https://docs.celeryq.dev/en/stable/userguide/periodic-tasks.html) to run our scheduled tasks, which gather data from various APIs and combine it into what is visible on our dashboard.

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Another volume is created for `/srv/t5gweb/static/node_modules/`. Without this v

If you want to add a new JS package, you'll need to add it to `package.json` and `package-lock.json` , which are located in `dashboard/src/t5gweb/static/`. Then you need to remove the relevant volume (`podman volume rm dashboard_dashboard-ui_<HASH>`) and rebuild the image.


Please see our [CONTRIBUTING.md](https://github.com/RHsyseng/t5g-field-support-team-utils/blob/main/CONTRIBUTING.md) for further development help.
## CI

This project has a CI that is triggered on every push.
Expand Down