From deefbfb0d1b15fb2289b6d642d4ed0fb404cd1ea Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Fri, 1 Dec 2023 22:12:51 +0100 Subject: [PATCH] Enable Prettier for changelog validation (#219) * Enable Prettier for changelog validation * Remove changelog from Prettier ignore list * Bump auto-changelog in package.json * Bump action-create-release-pr to v3 * Fix changelog formatting * Fix CI lint changelog command --- .github/workflows/build-lint-test.yml | 4 ++-- .github/workflows/create-release-pr.yml | 2 +- CHANGELOG.md | 1 + package.json | 6 +++--- yarn.lock | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-lint-test.yml b/.github/workflows/build-lint-test.yml index 4b6e025..fd98178 100644 --- a/.github/workflows/build-lint-test.yml +++ b/.github/workflows/build-lint-test.yml @@ -55,10 +55,10 @@ jobs: - run: yarn lint - name: Validate RC changelog if: ${{ startsWith(github.head_ref, 'release/') }} - run: yarn auto-changelog validate --rc + run: yarn lint:changelog --rc - name: Validate changelog if: ${{ !startsWith(github.head_ref, 'release/') }} - run: yarn auto-changelog validate + run: yarn lint:changelog - name: Require clean working directory shell: bash run: | diff --git a/.github/workflows/create-release-pr.yml b/.github/workflows/create-release-pr.yml index 681ce6c..8988f38 100644 --- a/.github/workflows/create-release-pr.yml +++ b/.github/workflows/create-release-pr.yml @@ -33,7 +33,7 @@ jobs: uses: actions/setup-node@v3 with: node-version-file: '.nvmrc' - - uses: MetaMask/action-create-release-pr@v2 + - uses: MetaMask/action-create-release-pr@v3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c87cbc..ffa0b6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Changelog + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), diff --git a/package.json b/package.json index 0d992c1..04853eb 100644 --- a/package.json +++ b/package.json @@ -30,12 +30,12 @@ "build:docs": "typedoc", "build:types": "tsc --project tsconfig.build.json", "lint": "yarn lint:eslint && yarn lint:constraints && yarn lint:misc --check && yarn lint:dependencies --check && yarn lint:changelog", - "lint:changelog": "auto-changelog validate", + "lint:changelog": "auto-changelog validate --prettier", "lint:constraints": "yarn constraints", "lint:dependencies": "depcheck && yarn dedupe", "lint:eslint": "eslint . --cache --ext js,ts", "lint:fix": "yarn lint:eslint --fix && yarn lint:constraints --fix && yarn lint:misc --write && yarn lint:dependencies && yarn lint:changelog", - "lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern", + "lint:misc": "prettier '**/*.json' '**/*.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern", "prepack": "./scripts/prepack.sh", "test": "jest && jest-it-up", "test:watch": "jest --watch" @@ -43,7 +43,7 @@ "devDependencies": { "@lavamoat/allow-scripts": "^2.3.1", "@lavamoat/preinstall-always-fail": "^1.0.0", - "@metamask/auto-changelog": "^3.1.0", + "@metamask/auto-changelog": "^3.4.3", "@metamask/eslint-config": "^12.2.0", "@metamask/eslint-config-jest": "^12.1.0", "@metamask/eslint-config-nodejs": "^12.1.0", diff --git a/yarn.lock b/yarn.lock index 8316278..b8252f1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1032,7 +1032,7 @@ __metadata: languageName: node linkType: hard -"@metamask/auto-changelog@npm:^3.1.0": +"@metamask/auto-changelog@npm:^3.4.3": version: 3.4.3 resolution: "@metamask/auto-changelog@npm:3.4.3" dependencies: @@ -1103,7 +1103,7 @@ __metadata: dependencies: "@lavamoat/allow-scripts": ^2.3.1 "@lavamoat/preinstall-always-fail": ^1.0.0 - "@metamask/auto-changelog": ^3.1.0 + "@metamask/auto-changelog": ^3.4.3 "@metamask/eslint-config": ^12.2.0 "@metamask/eslint-config-jest": ^12.1.0 "@metamask/eslint-config-nodejs": ^12.1.0