ci: format the GameDB and make sure it stays that way

This commit is contained in:
Tyler Wilding 2022-05-22 21:10:47 -04:00 committed by refractionpcsx2
parent b54facdbd8
commit 9ba42ec950
4 changed files with 48 additions and 39 deletions

View File

@ -14,6 +14,7 @@ on:
jobs:
lint:
name: Lint and Validate GameDB
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
@ -30,4 +31,4 @@ jobs:
- name: Check Formatting
run: |
npm install -g prettier
prettier --check ./bin/Resources/GameIndex.yaml
prettier --check ./bin/resources/GameIndex.yaml

View File

@ -213,7 +213,7 @@ option_validation_handlers = {
class UniqueKeyLoader(yaml.FullLoader):
def construct_mapping(self, node, deep=False):
mapping = set()
for key_node, value_node in node.value:
for key_node, _ in node.value:
key = self.construct_object(key_node, deep=deep)
if key in mapping:
raise ValueError(f"Duplicate {key!r} key found in YAML.")

8
.prettierrc.yaml Normal file
View File

@ -0,0 +1,8 @@
overrides:
- files: "**/GameIndex.yaml"
options:
tabWidth: 2
useTabs: false
quoteProps: consistent
endOfLine: auto
proseWrap: preserve