{"html_url": "https://github.com/simonw/datasette/issues/1166#issuecomment-783560017", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1166", "id": 783560017, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MzU2MDAxNw==", "user": {"value": 94334, "label": "thorn0"}, "created_at": "2021-02-22T18:00:57Z", "updated_at": "2021-02-22T18:13:11Z", "author_association": "NONE", "body": "Hi! I don't think Prettier supports this syntax for globs: `datasette/static/*[!.min].js` Are you sure that works?\r\nPrettier uses https://github.com/mrmlnc/fast-glob, which in turn uses https://github.com/micromatch/micromatch, and the docs for these packages don't mention this syntax. As per the docs, square brackets should work as in regexes (`foo-[1-5].js`).\r\n\r\nTested it. Apparently, it works as a negated character class in regexes (like `[^.min]`). I wonder where this syntax comes from. Micromatch doesn't support that:\r\n\r\n```js\r\nmicromatch(['static/table.js', 'static/n.js'], ['static/*[!.min].js']);\r\n// result: [\"static/n.js\"] -- brackets are treated like [!.min] in regexes, without negation\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777140799, "label": "Adopt Prettier for JavaScript code formatting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1166#issuecomment-753224351", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1166", "id": 753224351, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzIyNDM1MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-31T23:23:29Z", "updated_at": "2020-12-31T23:23:29Z", "author_association": "OWNER", "body": "I should configure the action to only run if changes have been made within the `datasette/static` directory.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777140799, "label": "Adopt Prettier for JavaScript code formatting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1166#issuecomment-753214664", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1166", "id": 753214664, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzIxNDY2NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-31T21:58:04Z", "updated_at": "2020-12-31T21:58:04Z", "author_association": "OWNER", "body": "Wrote a TIL about this: https://til.simonwillison.net/github-actions/prettier-github-actions", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777140799, "label": "Adopt Prettier for JavaScript code formatting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1166#issuecomment-753211535", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1166", "id": 753211535, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzIxMTUzNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-31T21:46:04Z", "updated_at": "2020-12-31T21:46:04Z", "author_association": "OWNER", "body": "https://github.com/simonw/datasette/runs/1631682372?check_suite_focus=true failed!\r\n\r\n\"Trying_out_bad_formatting__refs__1166_\u00b7_simonw_datasette_8087091\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777140799, "label": "Adopt Prettier for JavaScript code formatting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1166#issuecomment-753210536", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1166", "id": 753210536, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzIxMDUzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-31T21:45:19Z", "updated_at": "2020-12-31T21:45:19Z", "author_association": "OWNER", "body": "Oops, committed that bad formatting test to `main` instead of a branch!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777140799, "label": "Adopt Prettier for JavaScript code formatting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1166#issuecomment-753209192", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1166", "id": 753209192, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzIwOTE5Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-31T21:44:22Z", "updated_at": "2020-12-31T21:44:22Z", "author_association": "OWNER", "body": "Tests passed in https://github.com/simonw/datasette/runs/1631677726?check_suite_focus=true\r\n\r\nI'm going to try submitting a pull request with badly formatted JavaScript to see if it gets caught.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777140799, "label": "Adopt Prettier for JavaScript code formatting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1166#issuecomment-753200580", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1166", "id": 753200580, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzIwMDU4MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-31T21:38:06Z", "updated_at": "2020-12-31T21:38:06Z", "author_association": "OWNER", "body": "I think this should work:\r\n```\r\n- uses: actions/cache@v2\r\n with:\r\n path: ~/.npm\r\n key: ${{ runner.os }}-node-${{ hashFiles('**/prettier.yml' }}\r\n```\r\nI'll use the `prettier.yml` workflow that I'm about to create as the cache key for the NPM cache.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777140799, "label": "Adopt Prettier for JavaScript code formatting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1166#issuecomment-753197957", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1166", "id": 753197957, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzE5Nzk1Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-31T21:36:14Z", "updated_at": "2020-12-31T21:36:14Z", "author_association": "OWNER", "body": "Maybe not that action actually - I wanted to use a pre-built action to avoid installing Prettier every time, but that's what it seems to do: https://github.com/creyD/prettier_action/blob/bb361e2979cff283ca7684908deac8f95400e779/entrypoint.sh#L28-L37", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777140799, "label": "Adopt Prettier for JavaScript code formatting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1166#issuecomment-753195905", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1166", "id": 753195905, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzE5NTkwNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-31T21:34:46Z", "updated_at": "2020-12-31T21:34:46Z", "author_association": "OWNER", "body": "This action looks good - tag 3.2 is equivalent to this commit hash: https://github.com/creyD/prettier_action/tree/bb361e2979cff283ca7684908deac8f95400e779", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777140799, "label": "Adopt Prettier for JavaScript code formatting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1166#issuecomment-753193475", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1166", "id": 753193475, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzE5MzQ3NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-31T21:33:00Z", "updated_at": "2020-12-31T21:33:00Z", "author_association": "OWNER", "body": "I want a CI check that confirms that files conform to prettier - but only `datasette/static/*.js` files that are not already minified.\r\n\r\nThis seems to do the job:\r\n\r\n npx prettier --check 'datasette/static/*[!.min].js'\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777140799, "label": "Adopt Prettier for JavaScript code formatting"}, "performed_via_github_app": null}