Commit Graph

23 Commits

Author SHA1 Message Date
Martin Brennan 36fc587f4c
DEV: pnpm ember-template-lint should not use run command (#28726)
On pre-commit, various people were getting an error like this:

> ERR_PNPM_NO_SCRIPT Missing script: ember-template-lint

This was because in our lefthook config we were doing
`pnpm run ember-template-lint` rather than the correct
`pnpm ember-template-lint`
2024-09-04 16:19:11 +10:00
David Taylor 80b9c280ba
DEV: Switch to pnpm for JS dependencies (#28671)
This will bring significant improvements to install speed & storage requirements. For information on how it may affect you, see https://meta.discourse.org/t/324521

This commit:
- removes the `yarn.lock` and replaces with `pnpm-lock.yaml`
- updates workspaces to pnpm format
- adjusts package dependencies to work with pnpm's stricter resolution strategy
- updates Rails app to load modules from more specific node_modules directories
- adds a `.pnpmfile` which automatically cleans up old yarn-managed `node_modules` directories
- updates various scripts to call `pnpm` instead of `yarn`
- updates patches to use pnpm's native patch system instead of patch-package
- adds a patch for licensee to support pnpm
2024-09-03 10:51:07 +01:00
Ted Johansson d892092151
DEV: Add Lefthook command to auto-correct staged files (#27620)
Often when the pre-commit hook is run and reports a problem, I want to follow up by running the auto-correct command of the respective linter, but that means I need to remember what to run. "Let's see. Did prettier need a double-dash before write or not?"

This change adds a lefthook run fix-staged command that runs linter auto-corrects on any staged files.
2024-06-26 16:08:47 +08:00
Martin Brennan d4e262d5dc
DEV: Add syntax_tree check to lefthook (#19877)
Adds the pre-commit hook for syntax_tree to lefthook. Didn't
add the normal linter because it seems to have a max file
limit, which we exceed with a combination of *.rb and *.rake.
If the format doesn't match on commit we get this:

```
EXECUTE > syntax_tree
[warn] lib/post_jobs_enqueuer.rb
[warn] lib/tasks/s3.rake
The listed files did not match the expected format.
```
2023-01-17 10:16:07 +10:00
Gerhard Schlager 295e2c85a6
DEV: Upgrade "lefthook" and skip hooks during merge/rebase (#18910)
The old lefthook package was deprecated a long time ago and skipping hooks during merge/rebase makes those git commands a lot faster.
2022-11-07 17:13:21 +01:00
Jarek Radosz 64adf3cba3
DEV: Don't template-lint all files in lefthook (#17255)
Just templates is a-ok, thx :P
2022-06-27 20:01:13 +02:00
Gerhard Schlager 2d143ec2fb
DEV: Improve lefthook config and remove some slow hooks (#16626)
They were slowing down checkout, merge and rewrite.
This also cleans up the "lints" section which was running into problems with `{all_files}` being too much for some tools to handle. And it makes sure that eslint and prettier runs for core plugins as well.
2022-05-04 17:37:01 +02:00
Martin Brennan df6003aef5
DEV: Lint SCSS with prettier in pre-commit (#15033)
We are linting SCSS on the GitHub actions CI but not
on pre-commit, which can lead to lint failures in CI.
Better to warn developers about this locally like
our other lints.
2021-11-22 11:30:12 +10:00
Jarek Radosz 4ad77f3382
DEV: Remove `.es6` extensions from core (#14912)
Still supported in plugins though.
2021-11-13 12:51:53 +01:00
Joffrey JAFFEUX 4cb65675c6
DEV: uses main branch in lefthooks (#13792) 2021-07-20 10:18:55 +02:00
Joffrey JAFFEUX 60f10e9067
DEV: experiments parallel prettier (#11854)
For now only attempts to use it in pre-commit hook
2021-01-27 17:25:48 +01:00
Gerhard Schlager 208d85aaff DEV: Ensure prettier uses the same patterns everywhere 2020-08-20 16:27:32 +02:00
Gerhard Schlager f683c5d0e0 DEV: Check English locale for errors in CI
Moves the most important checks into a linter. It gets executed by Lefthook as well as the docker rake task and Github actions. Doing those checks in rspec takes too long and it produces errors when the discourse:test Docker image contains old, invalid locale files.
2020-06-03 21:54:58 +02:00
Guo Xiang Tan 960fd94758
DEV: Run rubocop in parallel in pre-commit hook. 2020-04-29 13:48:59 +08:00
Martin Brennan 72a3f387f2 Only run ember-template-lint precommit on staged files
* instead of running on the whole app folder, which just adds extra
  overhead
2020-04-15 15:57:28 +10:00
Robin Ward 032205e202 Rename many `.js.es6` files to `.js` 2020-03-12 13:29:55 -04:00
Mark VanLandingham c11e5eb042
DEV: Run prettier on staged files before commit using lefthook (#9064)
* DEV: Run prettier on staged files before commit using lefthook

* excluded some js files
2020-03-02 14:30:23 -05:00
Robin Ward 603c56f71c FIX: Lefthook was not excluding enough JS 2020-02-25 17:28:53 -05:00
Joffrey JAFFEUX dafd3c3b47
DEV: enforces no self-closing-void-elements (#8879) 2020-02-06 17:26:06 +01:00
Robin Ward abff3716ba
Upgrade handlebars (#8675)
* Upgrade Handlebars to 4.3.0

* Upgrade Handlebars to the latest version
2020-01-07 15:37:37 -05:00
Sam Saffron 412e1ebbe2 DEV: correct parallel specs rake tasks
This used to work due to side effects.

`rake parallel:migrate` used to work very inconsistently and would only migrate
some of the databases.

This introduces the recommended change to db.yml so the correct database is
found based off TEST_ENV_NUMBER if for some reason we did not set it using
RAILS_DB

Also avoids a bunch of schema dumping which is not needed when migrating
parallel specs



DB number 1 is very odd cause for whatever reason parallel spec is not
setting it.
2019-12-31 14:07:55 +11:00
Penar Musaraj 16cdf94001 DEV: Fix files targetted by Lefthook Prettier
The previous glob rule was skipping files in sub-subfolders, causing discrepancies between Travis and Jenkins results.
2019-11-15 09:21:51 -05:00
Abroskin Alexander 0872a1182d DEV: Replace Overcommit with Lefthook (#7826)
Overcommit uses prebuilt hooks and require global installation.
To avoid this issues replace it with Lefthook.
Lefthook will be installed with npm packages. New contributors
will have fully consistent git hooks.
2019-07-02 11:29:52 +02:00