question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improved workflow: Speedup pre-commit, sync up max line length

See original GitHub issue

Is your feature request related to a problem? If yes, please describe it.

I noticed within some teams that certain formatting/rules aren’t applied that are defined in the pre-commit process. When talking to some of them I noticed that they find the pre-commit taking too long and simply go for --no-verify to speed up committing code, causing issues later on.

Describe the desired solution.

Remove the jest step to speedup pre-commit and make this part of the development sub branches CI. e.g. someone pushes code / creates PR = run tests

Provide additional context.

I also wonder why the gitlab config is part of this source code as it doesn’t run on gitlab CI

And while at it you might perhaps also fix this: https://github.com/intershop/intershop-pwa/blob/983ae82f0d609ed7c0a8fe6c477aff88ca485689/.prettierrc.json#L2 https://github.com/intershop/intershop-pwa/blob/983ae82f0d609ed7c0a8fe6c477aff88ca485689/tslint.json#L50

Either all 120 or all 140, i personally prefer 120, but as long as they’re in sync it’s fine by me.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ismail-codinglabcommented, Mar 3, 2021

Makes sense, well thanks @jometzner @dhhyi ! I will try push for those changes internally

0reactions
dhhyicommented, Mar 3, 2021

Hi @ismail-codinglab,

I agree with @jometzner on keeping the jest pre-commit hook as it is. If you have trouble motivating your colleagues, you can modify it for your project. Either remove it altogether or just remove the --findRelatedTests argument from jest. The latter one increases the amount of tests quite significantly if you are modifying core files. I would also encourage the people I work with to make smaller commits, that are well scoped and well defined. This helps with reviewing code and also helps when you are looking for bugs and want to find out what any previous change was originally intended to implement. That’s the way we have done it here and we don’t find that much resistance to this approach.

A complete test run should always be part of the CI anyway as some artifacts are loosely coupled and findRelatedTests won’t find them in rare cases.

We didn’t actually integrate the PR #484 you have been linking. Maybe working without --findRelatedTests but with --runInBand is a solution that works for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improve platform command line length limits #691 - GitHub
I have a question related to #510 When I run pre-commit run all hooks work as expected (processing just changed files), but pre-commit...
Read more >
Running Python Linters with Pre-commit Hooks
The default line length of black formatter is 88 (you should embrace that) but flake8 caps the line at 79 characters. This raises...
Read more >
Using pre-commit to automate development workflow in ... - Blog
In the example above we edited max-line-length since Black has a limit of 90 characters instead of 88. To test here's a sample...
Read more >
Push rules - GitLab Docs
Maximum file size: Added or updated files must not exceed this file size (in MB). To allow files of any size, set to...
Read more >
P4V User Guide - Perforce
Terminology differences between command line client and P4V ... To speed up reconcile operations, you can set the Modtime option for the workspace....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found