Skip to content

Commit

Permalink
Merge pull request #990 from rommapp/fix/fixes-from-trunk
Browse files Browse the repository at this point in the history
Fixed everything from trunk
  • Loading branch information
zurdi15 committed Jul 9, 2024
2 parents 1372327 + 300262e commit c82ae97
Show file tree
Hide file tree
Showing 57 changed files with 487 additions and 733 deletions.
20 changes: 9 additions & 11 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
### Description
# Pull request template

<sup>Please describe the changes or enhancements you are proposing with this pull request.</sup>
## Description

### Related Issues
Please describe the changes or enhancements you are proposing with this pull request.

<sup>List any related issues that are addressed or fixed by this pull request.</sup>
## Related Issues

### Checklist
List any related issues that are addressed or fixed by this pull request.

## Checklist

Please check all that apply.

Expand All @@ -17,10 +19,6 @@ Please check all that apply.
- [ ] I've added unit tests that cover the changes
- [ ] All existing tests are passing

### Additional Notes

<sup>Add any additional information or context about the pull request here.</sup>

```
## Additional Notes

```
Add any additional information or context about the pull request here.
12 changes: 6 additions & 6 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,24 @@ runtimes:
lint:
enabled:
- markdownlint@0.41.0
- eslint@8.57.0
- eslint@9.6.0
- actionlint@1.7.1
- bandit@1.7.9
- black@24.4.2
- checkov@3.2.139
- checkov@3.2.178
- git-diff-check
- isort@5.13.2
- mypy@1.10.0
- osv-scanner@1.7.4
- mypy@1.10.1
- osv-scanner@1.8.1
- oxipng@9.1.1
- prettier@3.3.2
- ruff@0.4.9
- ruff@0.5.1
- shellcheck@0.10.0
- shfmt@3.6.0
- svgo@3.3.2
- taplo@0.8.1
- trivy@0.52.2
- trufflehog@3.78.1
- trufflehog@3.79.0
- yamllint@1.35.1
ignore:
- linters: [ALL]
Expand Down
661 changes: 226 additions & 435 deletions CHANGELOG.md

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
## Contributing to RomM
# Contributing to RomM

Thank you for considering contributing to RomM! This document outlines some guidelines to help you get started with your contributions.

**If you're looking to implement a large feature or make significant changes to the project, it's best to open an issue first AND join the Discord to discuss your ideas with the maintainers.**

### Code of Conduct
## Code of Conduct

Please note that this project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md). By participating in this project, you are expected to uphold this code.

### Contributing to the Wiki
## Contributing to the Wiki

If you would like to contribute to the project's [documentation](https://github.com/rommapp/romm/wiki), reach out to the maintainers to get edit access. We welcome any contributions that help improve the documentation (new pages, updates, or corrections).

### How to Contribute Code
## How to Contribute Code

1. Fork the repository.
2. Clone your forked repository: `git clone https://github.com/your-username/romm.git`
Expand All @@ -23,15 +23,15 @@ If you would like to contribute to the project's [documentation](https://github.
7. Push your changes to your fork: `git push origin feature-or-fix-name`
8. Open a pull request to the `master` branch of the original repository.

### Pull Request Guidelines
## Pull Request Guidelines

- Make sure your code follows the project's coding standards.
- Test your changes locally before opening a pull request.
- Update the documentation if necessary.
- Ensure all existing tests pass, and add new tests for new functionality.
- Use clear and descriptive titles and descriptions for your pull requests.

### Code Style
## Code Style

Follow the existing code style used throughout the project. If working with VSCode or a similar editor, consider installing these extensions:

Expand All @@ -41,11 +41,11 @@ Follow the existing code style used throughout the project. If working with VSCo
- [Ruff](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff)
- [Vue - Official](https://marketplace.visualstudio.com/items?itemName=Vue.volar)

### Issue Reporting
## Issue Reporting

If you encounter any bugs or have suggestions for improvements, please [create an issue](https://github.com/rommapp/romm/issues) on GitHub. Provide as much detail as possible, including steps to reproduce the issue if applicable.

### Licensing
## Licensing

By contributing to ROMM, you agree that your contributions will be licensed under the project's [LICENSE](LICENSE).

Expand Down
38 changes: 20 additions & 18 deletions DEVELOPER_SETUP.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Environment setup
# Setup for development environment

## Mocking RomM structure
## Environment setup

### - Create the mock structure with at least one rom and empty config for manual testing
### Mocking RomM structure

#### - Create the mock structure with at least one rom and empty config for manual testing

```sh
mkdir -p romm_mock/library/roms/switch
Expand All @@ -13,26 +15,26 @@ mkdir -p romm_mock/config
touch romm_mock/config.yml
```

## Setting up the backend
### Setting up the backend

### - Copy env.template to .env and fill the variables
#### - Copy env.template to .env and fill the variables

```sh
cp env.template .env
```

### - Install system dependencies
#### - Install system dependencies

```sh
# https://mariadb.com/docs/skysql-previous-release/connect/programming-languages/c/install/#Installation_via_Package_Repository_(Linux):
sudo apt install libmariadb3 libmariadb-dev pipx
```

### - Install python dependencies
#### - Install python dependencies

You'll need poetry installed

https://python-poetry.org/docs/#installing-with-the-official-installer
<https://python-poetry.org/docs/#installing-with-the-official-installer>

```sh
pipx install poetry
Expand All @@ -46,13 +48,13 @@ Then create the virtual environment
poetry install --sync
```

### - Spin up mariadb in docker
#### - Spin up mariadb in docker

```sh
docker-compose up -d
```

### - Run the backend
#### - Run the backend

*\_\_*Migrations will be run automatically when running the backend.\_\_\*

Expand All @@ -61,42 +63,42 @@ cd backend
poetry run python3 main.py
```

### - Start a worker
#### - Start a worker

```sh
cd backend
poetry run python3 worker.py
```

## Setting up the frontend
### Setting up the frontend

### - Install node.js dependencies
#### - Install node.js dependencies

```sh
cd frontend
# npm version >= 9 needed
npm install
```

### - Create symlink to library and resources
#### - Create symlink to library and resources

```sh
mkdir assets/romm
ln -s ../backend/romm_mock/resources assets/romm/resources
ln -s ../backend/romm_mock/assets assets/romm/assets
```

### - Run the frontend
#### - Run the frontend

```sh
npm run dev
```

## Setting up the linter
### Setting up the linter

We use [Trunk](https://trunk.io) for linting, which combines multiple linters and formatters with sensible defaults and a single configuration file. You'll need to install the Trunk CLI to use it.

### - Install the Trunk CLI
#### - Install the Trunk CLI

```sh
curl https://get.trunk.io -fsSL | bash
Expand All @@ -111,7 +113,7 @@ trunk check

**Failing to install and run the linter will result in a failed CI check, which won't allow us to merge your PR.**

# Test setup
## Test setup

### - Create the test user and database with root user

Expand Down
25 changes: 5 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- trunk-ignore-all(markdownlint/MD033) -->
<!-- trunk-ignore(markdownlint/MD041) -->
<div align="center">

<img src=".github/resources/romm_complete.svg" height="220px" width="auto" alt="romm logo">
Expand Down Expand Up @@ -27,8 +29,6 @@
- [Naming Convention](#naming-convention)
- [Community](#community)

<a name ='overview'> </a>

# Overview

RomM (ROM Manager) allows you to scan, enrich, and browse your game collection with a clean and responsive interface. With support for multiple platforms, various naming schemes, and custom tags, RomM is a must-have for anyone who plays on emulators.
Expand All @@ -46,11 +46,9 @@ RomM (ROM Manager) allows you to scan, enrich, and browse your game collection w

## Preview

| 🖥 Desktop | 📱 Mobile |
| :-----------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------: |
| <img src=".github/resources/screenshots/romm-desktop-slider.gif" /> | <img style="width: 325px; aspect-ratio: auto;" src=".github/resources/screenshots/romm-mobile-slider.gif" /> |

<a name ='installation'> </a>
| 🖥 Desktop | 📱 Mobile |
| :---------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------: |
| <img src=".github/resources/screenshots/romm-desktop-slider.gif" alt="desktop preview" /> | <img style="width: 325px; aspect-ratio: auto;" src=".github/resources/screenshots/romm-mobile-slider.gif" alt="mobile preview" /> |

# Installation

Expand All @@ -65,8 +63,6 @@ Before running the [image][docker-tags], please ensure that Docker is installed
# Configuration

<a name ='folder-structure'> </a>

## Folder Structure

As mentioned in the installation section, RomM requires a specific folder structure. The two supported structures are as follows:
Expand Down Expand Up @@ -155,8 +151,6 @@ RomM's "understanding" of your library can be configured with a `config.yaml` fi

The scheduler allows you to schedule async tasks that run in the Redis container at regular intervals. Jobs can be run at a specific time in the future, after a time delta, or at recurring internals using cron notation. The [wiki page on the scheduler][wiki-scheduled-tasks] has more information on which tasks are available and how to enable them.

<a name ='naming-convention'> </a>

# Naming Convention

## Platform Support
Expand All @@ -174,8 +168,6 @@ Games can be tagged with region, revision, or other tags by using parentheses in

Tags can be used to search for games in the search bar. For example, searching for **(USA)** will return all games with the USA tag.

<a name ='community'> </a>

# Community

Here are a few projects maintained by members of our community. Since the RomM team does not regularly review them, **we recommend that you review them closely before you use them**.
Expand Down Expand Up @@ -207,7 +199,6 @@ Here are a few projects that we think you might like:

[folder-structure]: #folder-structure
[platform-support]: #platform-support
[authentication]: #authentication
[tag-support]: #tag-support
[configuration-file]: #configuration-file

Expand Down Expand Up @@ -254,11 +245,5 @@ Here are a few projects that we think you might like:
[docker-tags]: https://hub.docker.com/r/rommapp/romm/tags
[igdb-api]: https://api-docs.igdb.com/#account-creation
[mobygames-api]: https://www.mobygames.com/info/api/
[titleid-program-id]: https://switchbrew.org/w/index.php?title=Title_list/Games&mobileaction=toggle_view_desktop
[igdb-platforms-list]: https://www.igdb.com/platforms
[big-bear-casaos]: https://github.com/bigbeartechworld/big-bear-casaos
[kubernetes-helm-chart]: https://artifacthub.io/packages/helm/crystalnet/romm
[pc-mac-icons]: https://www.flaticon.com/free-icons/keyboard-and-mouse
[flaticon]: https://www.flaticon.com
[user-default-icon]: https://icons8.com/icon/tZuAOUGm9AuS/user-default
[icons8]: https://icons8.com
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Reporting Security Issues
# Reporting Security Issues

Thanks for helping make RomM safer for everyone.

Expand Down
7 changes: 5 additions & 2 deletions backend/endpoints/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ async def search_rom(
@protected_route(router.get, "/search/cover", ["roms.read"])
async def search_cover(
request: Request,
search_term: str | None = None,
search_term: str = "",
) -> list[SearchCoverSchema]:

if not STEAMGRIDDB_API_ENABLED:
Expand All @@ -123,4 +123,7 @@ async def search_cover(
detail="No SteamGridDB enabled",
)

return meta_sgdb_handler.get_details(search_term)
return [
SearchCoverSchema.model_validate(cover)
for cover in meta_sgdb_handler.get_details(search_term)
]
1 change: 0 additions & 1 deletion backend/handler/metadata/sgdb_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def get_details(self, search_term: str) -> list[dict[str, Any]]:
],
}
)

return games


Expand Down
1 change: 0 additions & 1 deletion frontend/src/__generated__/index.ts

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

1 change: 0 additions & 1 deletion frontend/src/__generated__/models/AddFirmwareResponse.ts

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

1 change: 0 additions & 1 deletion frontend/src/__generated__/models/AddRomsResponse.ts

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

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

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

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

Loading

0 comments on commit c82ae97

Please sign in to comment.