-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding pre-commit install to make dev #6417
Changes from 4 commits
f7d2682
d3c7979
7ee9fb3
a553516
b4bf3b4
4d6945f
39c7f81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Fixes | ||
body: add pre-commit install to make dev script in Makefile | ||
time: 2022-12-12T11:59:12.175136-05:00 | ||
custom: | ||
Author: justbldwn | ||
Issue: "6269" | ||
PR: "6417" |
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -20,7 +20,13 @@ CI_FLAGS =\ | |||||||||||||||
DBT_LOG_FORMAT=json | ||||||||||||||||
|
||||||||||||||||
.PHONY: dev | ||||||||||||||||
dbeatty10 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||
dev: ## Installs dbt-* packages in develop mode along with development dependencies. | ||||||||||||||||
dev: ## Installs dbt-* packages in develop mode along with development dependencies and pre-commit. | ||||||||||||||||
@\ | ||||||||||||||||
pip install -r dev-requirements.txt -r editable-requirements.txt && \ | ||||||||||||||||
pre-commit install | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not a Make guru, but it seems like this would be more DRY if re-factored like this:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i like this a lot - thanks for the tip! hadn't considered this, but it makes total sense this way. it should now be written this way in the latest commit (b4bf3b4) |
||||||||||||||||
|
||||||||||||||||
dbeatty10 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||
.PHONY: dev_req | ||||||||||||||||
dev_req: ## Installs dbt-* packages in develop mode along with only development dependencies. | ||||||||||||||||
@\ | ||||||||||||||||
pip install -r dev-requirements.txt -r editable-requirements.txt | ||||||||||||||||
|
||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the addition of the
dev_req
rule, adding this section makes sense on first blush.But... the contributing file already seems unbearably long to me. I wish it was like 75% shorter rather than even just a few lines longer.
Anyone that knows good reasons why they don't want the
pre-commit install
step probably has keen enough eyes to know that they can omit it and just run:This is a case in which "less is more" and we can just omit explicitly documenting how to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gshank I would prefer to exclude additional instructions to describe how to omit installation of
pre-commit
hooks for three main reasons:pre-commit
seems obvious without explanation neededHow would you feel about going back to the more simple instructions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no need to describe how to use dev_req. Just have a Makefile target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good @gshank!
@justbldwn If you commit my two suggestions (including the one to remove the "Installation without
pre-commit
" section), I think we'll be good to go!You'll probably want to make a final pass through your edits to make sure everything reads the way you want it to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dbeatty10 @gshank thank you both for the helpful feedback here! i just pushed up a new commit to remove a chunk from the
CONTRIBUTING.md
about usingmake dev_req
, and instead just left instructions for usingmake dev
. however, thedev_req
target in theMakefile
still exists for anyone that may want to use it.