danger / danger-js

⚠️ Stop saying "you forgot to …" in code review
http://danger.systems/js/
MIT License
5.24k stars 367 forks source link

Linter: Apply prettier to all files #1358

Closed glensc closed 1 year ago

glensc commented 1 year ago

I was creating this PR:

...and it added formatting changes to code I didn't modify

While I'm personally not a fan of prettier formatting, I'm totally against some git hook stuffing unrelated formatting changes to the commit to code I didn't modify.


The changes were produced with:

$ git ls-files '*.ts' | xargs yarn lint:fix
$ git ls-files '*.ts' | xargs yarn prettier --write

and staged every chunk manually

I've omitted this change by lint:fix, as it does not seem to be safe change:

diff --git a/dangerfile.lite.ts b/dangerfile.lite.ts
index b32e107a..e98715a7 100644
--- a/dangerfile.lite.ts
+++ b/dangerfile.lite.ts
@@ -1,7 +1,7 @@
 import * as fs from "fs"

 import { DangerDSLType } from "./source/dsl/DangerDSL"
-declare var danger: DangerDSLType
+declare let danger: DangerDSLType
 declare function warn(params: string): void

 const hasChangelog = danger.git.modified_files.includes("CHANGELOG.md")
github-actions[bot] commented 1 year ago
Warnings
:warning: Please add a changelog entry for your changes. You can find it in `CHANGELOG.md` Please add your change and name to the main section.

Generated by :no_entry_sign: dangerJS against fa4cf9804e6b9e9763b71dc18cb2a4da74382d6f

glensc commented 1 year ago

@orta this is ready