mirror of https://github.com/PCSX2/pcsx2.git
ci: format the GameDB and make sure it stays that way
This commit is contained in:
parent
b54facdbd8
commit
9ba42ec950
|
@ -14,6 +14,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
|
name: Lint and Validate GameDB
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
|
@ -30,4 +31,4 @@ jobs:
|
||||||
- name: Check Formatting
|
- name: Check Formatting
|
||||||
run: |
|
run: |
|
||||||
npm install -g prettier
|
npm install -g prettier
|
||||||
prettier --check ./bin/Resources/GameIndex.yaml
|
prettier --check ./bin/resources/GameIndex.yaml
|
||||||
|
|
|
@ -213,7 +213,7 @@ option_validation_handlers = {
|
||||||
class UniqueKeyLoader(yaml.FullLoader):
|
class UniqueKeyLoader(yaml.FullLoader):
|
||||||
def construct_mapping(self, node, deep=False):
|
def construct_mapping(self, node, deep=False):
|
||||||
mapping = set()
|
mapping = set()
|
||||||
for key_node, value_node in node.value:
|
for key_node, _ in node.value:
|
||||||
key = self.construct_object(key_node, deep=deep)
|
key = self.construct_object(key_node, deep=deep)
|
||||||
if key in mapping:
|
if key in mapping:
|
||||||
raise ValueError(f"Duplicate {key!r} key found in YAML.")
|
raise ValueError(f"Duplicate {key!r} key found in YAML.")
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
overrides:
|
||||||
|
- files: "**/GameIndex.yaml"
|
||||||
|
options:
|
||||||
|
tabWidth: 2
|
||||||
|
useTabs: false
|
||||||
|
quoteProps: consistent
|
||||||
|
endOfLine: auto
|
||||||
|
proseWrap: preserve
|
Loading…
Reference in New Issue