From 1bce363bd35857d6b9b94260e5bd650e7b731a64 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Mon, 26 Jun 2023 13:04:21 +0200 Subject: [PATCH] Updated linting and migration comment to improve practices refs https://github.com/TryGhost/Toolbox/issues/602 - the new regex allows for the filename to contain seconds, which would have helped prevent a bug we had with migrations being in the wrong order - mentioned filename ordering in the migration review comment to bring that to the forefront of the mind --- .github/workflows/migration-review.yml | 2 +- ghost/core/.eslintrc.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/migration-review.yml b/.github/workflows/migration-review.yml index 56337a5b04..bbdb280b93 100644 --- a/.github/workflows/migration-review.yml +++ b/.github/workflows/migration-review.yml @@ -32,7 +32,7 @@ jobs: - [ ] Satisfies idempotency requirement (both `up()` and `down()`) - [ ] Does not reference models - - [ ] Filename is in the correct format + - [ ] Filename is in the correct format (and correctly ordered) - [ ] Targets the next minor version - [ ] All code paths have appropriate log messages - [ ] Uses the correct utils diff --git a/ghost/core/.eslintrc.js b/ghost/core/.eslintrc.js index 3e0132ac87..bb72473c20 100644 --- a/ghost/core/.eslintrc.js +++ b/ghost/core/.eslintrc.js @@ -30,7 +30,7 @@ module.exports = { 'core/server/data/migrations/versions/3.*/*' ], rules: { - 'ghost/filenames/match-regex': ['error', '^(?:\\d{2}|\\d{4}(?:-\\d{2}){4})(?:-[a-zA-Z]+){2,}$', true] + 'ghost/filenames/match-regex': ['error', '^(?:\\d{4}(?:-\\d{2}){4,5}|\\d{2})(?:-[a-zA-Z]+){2,}$', true] } }, {