Skip to content

Commit

Permalink
Merge branch 'master' into renovate-esbuild-0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
72636c committed Jul 14, 2023
2 parents 3c50f7d + eb72069 commit afb24cb
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 60 deletions.
10 changes: 2 additions & 8 deletions .changeset/cyan-knives-drop.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
'skuba': patch
---

template: Change some lambda worker info logs to debug
template/lambda-sqs-worker: Change some info logs to debug

The "Function succeeded" log message was changed from `info` to `debug`
to reduce the amount of unnecessary logs in production.
The message will still be logged in dev environments but at a `debug`
level.

The "Function succeeded" log message was retained as it is part of unit-testing
the handler.
The "Function succeeded" log message was changed from `info` to `debug` to reduce the amount of unnecessary logs in production. The message will still be logged in dev environments but at a `debug` level.
7 changes: 7 additions & 0 deletions .changeset/friendly-jokes-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'skuba': minor
---

format, lint: Have Prettier respect `.gitignore`

This aligns with the behaviour of the [Prettier 3.0 CLI](https://prettier.io/blog/2023/07/05/3.0.0.html#cli).
13 changes: 0 additions & 13 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
# managed by skuba
.idea/*
.vscode/*

.cdk.staging/
.serverless/
cdk.out/
node_modules*/

/coverage*/
/dist*/
/lib*/
/tmp*/

# Gantry resource files support non-standard template syntax
/.gantry/**/*.yaml
/.gantry/**/*.yml
Expand Down
4 changes: 1 addition & 3 deletions src/cli/__snapshots__/format.int.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ Prettier
Initialising Prettier...
Detected project root: <random>
Discovering files...
Discovered 10 files.
Discovered 9 files.
Formatting files...
.eslintcache
parser: -
.eslintignore
parser: -
.gitignore
Expand Down
4 changes: 1 addition & 3 deletions src/cli/__snapshots__/lint.int.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ ESLint │ ○ d.js
Prettier │ Initialising Prettier...
Prettier │ Detected project root: <random>
Prettier │ Discovering files...
Prettier │ Discovered 10 files.
Prettier │ Discovered 9 files.
Prettier │ Linting files...
Prettier │ .eslintcache
Prettier │ parser: -
Prettier │ .eslintignore
Prettier │ parser: -
Prettier │ .gitignore
Expand Down
10 changes: 7 additions & 3 deletions src/cli/adapter/prettier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,14 @@ export const runPrettier = async (

logger.debug('Discovering files...');

// Match Prettier's opinion of not respecting `.gitignore`.
// Match Prettier's opinion of respecting `.gitignore`.
// This avoids exhibiting different behaviour than a Prettier IDE integration,
// and the headache of conflicting `.gitignore` and `.prettierignore` rules.
const filepaths = await crawlDirectory(directory, '.prettierignore');
// though it may present headaches if `.gitignore` and `.prettierignore` rules
// conflict.
const filepaths = await crawlDirectory(directory, [
'.gitignore',
'.prettierignore',
]);

logger.debug(`Discovered ${pluralise(filepaths.length, 'file')}.`);

Expand Down
13 changes: 0 additions & 13 deletions src/cli/configure/analysis/__snapshots__/project.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,6 @@ yarn-error.log
},
".prettierignore": {
"data": "# managed by skuba
.idea/*
.vscode/*
.cdk.staging/
.serverless/
cdk.out/
node_modules*/
/coverage*/
/dist*/
/lib*/
/tmp*/
# Gantry resource files support non-standard template syntax
/.gantry/**/*.yaml
/.gantry/**/*.yml
Expand Down
8 changes: 4 additions & 4 deletions src/utils/dir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ export const buildPatternToFilepathMap = (
*/
export const crawlDirectory = async (
root: string,
ignoreFilename = '.gitignore',
ignoreFilenames = ['.gitignore'],
) => {
const ignoreFileFilter = await createInclusionFilter([
path.join(root, ignoreFilename),
]);
const ignoreFileFilter = await createInclusionFilter(
ignoreFilenames.map((ignoreFilename) => path.join(root, ignoreFilename)),
);

const output = await new FDir()
.crawlWithOptions(root, {
Expand Down
13 changes: 0 additions & 13 deletions template/base/_.prettierignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
# managed by skuba
.idea/*
.vscode/*

.cdk.staging/
.serverless/
cdk.out/
node_modules*/

/coverage*/
/dist*/
/lib*/
/tmp*/

# Gantry resource files support non-standard template syntax
/.gantry/**/*.yaml
/.gantry/**/*.yml
Expand Down

0 comments on commit afb24cb

Please sign in to comment.