Format YAML and JSON Files With Prettier (#4304)

* ci: format yaml and json files with prettier

* chore: add changelog entry

* fix: format everything

* ci: run pretter on all files

* ci: rename prettier step
This commit is contained in:
nerix 2023-01-15 17:27:41 +01:00 committed by GitHub
parent f933d9cdf2
commit 2233b46512
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 303 additions and 268 deletions

View file

@ -1,4 +1,4 @@
Checks: '-*,
Checks: "-*,
clang-diagnostic-*,
llvm-*,
misc-*,
@ -30,7 +30,7 @@ Checks: '-*,
-readability-function-cognitive-complexity,
-bugprone-easily-swappable-parameters,
-cert-err58-cpp,
'
"
CheckOptions:
- key: readability-identifier-naming.ClassCase
value: CamelCase

View file

@ -50,4 +50,3 @@ body:
label: OS and Chatterino Version
description: The name of your Operating System and the version shown in Chatterino's about settings page (⚙ -> about tab).
placeholder: Chatterino 2.3.5 (commit 81a62764, 2022-04-05) on Windows 10 Version 2009, kernel 10.0.19043

View file

@ -164,7 +164,7 @@ jobs:
id: review
with:
build_dir: build
config_file: '.clang-tidy'
config_file: ".clang-tidy"
split_workflow: true
- uses: actions/upload-artifact@v3

View file

@ -13,5 +13,5 @@ jobs:
- name: Changelog check
uses: dangoslen/changelog-enforcer@v3
with:
changeLogPath: 'CHANGELOG.md'
skipLabels: 'no changelog entry needed, ci, submodules'
changeLogPath: "CHANGELOG.md"
skipLabels: "no changelog entry needed, ci, submodules"

View file

@ -1,9 +1,9 @@
name: 'Publish Homebrew Cask on Release'
name: "Publish Homebrew Cask on Release"
on:
push:
tags:
# Should match semver for mainline releases (not including -beta)
- 'v2.[0-9]+.[0-9]+'
- "v2.[0-9]+.[0-9]+"
# TODO: handle beta and nightly releases
# Need to make those casks manually first
# - v2.[0-9]+.[0-9]+-beta(?:[0-9]+)
@ -16,8 +16,8 @@ env:
jobs:
update_stable_homebrew_cask:
name: 'Update the stable homebrew cask'
runs-on: 'macos-latest'
name: "Update the stable homebrew cask"
runs-on: "macos-latest"
steps:
# Pulls out the version from the ref (e.g. refs/tags/v2.3.1 -> 2.3.1)
- name: Execute brew bump-cask-pr with version

View file

@ -18,8 +18,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Lint Markdown files
- name: Check formatting with Prettier
uses: actionsx/prettier@v2
with:
# prettier CLI arguments.
args: --check '**/*.md'
args: --check .

View file

@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Download artifact'
- name: "Download artifact"
uses: actions/github-script@v6
with:
script: |
@ -32,7 +32,7 @@ jobs:
});
const fs = require('fs');
fs.writeFileSync('${{github.workspace}}/clang-tidy-review.zip', Buffer.from(download.data));
- name: 'Unzip artifact'
- name: "Unzip artifact"
run: unzip clang-tidy-review.zip
- uses: ZedThree/clang-tidy-review/post@v0.10.1

View file

@ -1,6 +1,23 @@
# emoji.json should remain minified
resources/emoji.json
# Ignore submodule files
lib/*/
conan-pkgs/*/
cmake/sanitizers-cmake/
.github/
# Build folders
*build-*/
[bB]uild
/_build/
# Editors
.vscode
.vs
.idea
dependencies
.cache
.editorconfig
# vcpkg
vcpkg_installed/

6
.prettierrc Normal file
View file

@ -0,0 +1,6 @@
trailingComma: es5
endOfLine: auto
overrides:
- files: "*.md"
options:
proseWrap: preserve

View file

@ -1,6 +0,0 @@
trailingComma = "es5"
[[overrides]]
files = ["*.md"]
[overrides.options]
proseWrap = "preserve"

View file

@ -35,6 +35,7 @@
- Dev: Fixed `inconsistent-missing-override` warnings. (#4296)
- Dev: Fixed `final-dtor-non-final-class` warnings. (#4296)
- Dev: Fixed `ambiguous-reversed-operator` warnings. (#4296)
- Dev: Format YAML and JSON files with prettier. (#4304)
## 2.4.0

View file

@ -9,14 +9,13 @@ AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakBeforeMultilineStrings: false
BasedOnStyle: Google
BraceWrapping: {
AfterClass: 'true'
AfterControlStatement: 'true'
AfterFunction: 'true'
AfterNamespace: 'false'
BeforeCatch: 'true'
BeforeElse: 'true'
}
BraceWrapping:
AfterClass: "true"
AfterControlStatement: "true"
AfterFunction: "true"
AfterNamespace: "false"
BeforeCatch: "true"
BeforeElse: "true"
BreakBeforeBraces: Custom
BreakConstructorInitializersBeforeComma: true
ColumnLimit: 80
@ -27,7 +26,28 @@ IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: true
IndentPPDirectives: AfterHash
IncludeBlocks: Preserve
SortIncludes: CaseInsensitive
IncludeBlocks: Regroup
IncludeCategories:
# Project includes
- Regex: '^"[a-zA-Z\._-]+(/[a-zA-Z0-9\._-]+)*"$'
Priority: 1
# Third party library includes
- Regex: '<[[:alnum:].]+/[a-zA-Z0-9\._\/-]+>'
Priority: 3
# Qt includes
- Regex: '^<Q[a-zA-Z0-9\._\/-]+>$'
Priority: 3
CaseSensitive: true
# LibCommuni includes
- Regex: "^<Irc[a-zA-Z]+>$"
Priority: 3
# Misc libraries
- Regex: '^<[a-zA-Z_0-9]+\.h(pp)?>$'
Priority: 3
# Standard library includes
- Regex: "^<[a-zA-Z_]+>$"
Priority: 4
NamespaceIndentation: Inner
PointerBindsToType: false
SpacesBeforeTrailingComments: 2

View file

@ -9,14 +9,13 @@ AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakBeforeMultilineStrings: false
BasedOnStyle: Google
BraceWrapping: {
AfterClass: 'true'
AfterControlStatement: 'true'
AfterFunction: 'true'
AfterNamespace: 'false'
BeforeCatch: 'true'
BeforeElse: 'true'
}
BraceWrapping:
AfterClass: "true"
AfterControlStatement: "true"
AfterFunction: "true"
AfterNamespace: "false"
BeforeCatch: "true"
BeforeElse: "true"
BreakBeforeBraces: Custom
BreakConstructorInitializersBeforeComma: true
ColumnLimit: 80
@ -41,13 +40,13 @@ IncludeCategories:
Priority: 3
CaseSensitive: true
# LibCommuni includes
- Regex: '^<Irc[a-zA-Z]+>$'
- Regex: "^<Irc[a-zA-Z]+>$"
Priority: 3
# Misc libraries
- Regex: '^<[a-zA-Z_0-9]+\.h(pp)?>$'
Priority: 3
# Standard library includes
- Regex: '^<[a-zA-Z_]+>$'
- Regex: "^<[a-zA-Z_]+>$"
Priority: 4
NamespaceIndentation: Inner
PointerBindsToType: false

View file

@ -9,14 +9,13 @@ AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakBeforeMultilineStrings: false
BasedOnStyle: Google
BraceWrapping: {
AfterClass: 'true'
AfterControlStatement: 'true'
AfterFunction: 'true'
AfterNamespace: 'false'
BeforeCatch: 'true'
BeforeElse: 'true'
}
BraceWrapping:
AfterClass: "true"
AfterControlStatement: "true"
AfterFunction: "true"
AfterNamespace: "false"
BeforeCatch: "true"
BeforeElse: "true"
BreakBeforeBraces: Custom
BreakConstructorInitializersBeforeComma: true
ColumnLimit: 80
@ -41,13 +40,13 @@ IncludeCategories:
Priority: 3
CaseSensitive: true
# LibCommuni includes
- Regex: '^<Irc[a-zA-Z]+>$'
- Regex: "^<Irc[a-zA-Z]+>$"
Priority: 3
# Misc libraries
- Regex: '^<[a-zA-Z_0-9]+\.h(pp)?>$'
Priority: 3
# Standard library includes
- Regex: '^<[a-zA-Z_]+>$'
- Regex: "^<[a-zA-Z_]+>$"
Priority: 4
NamespaceIndentation: Inner
PointerBindsToType: false