Skip to content

Place .PHONY in front of the commands #1021

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.PHONY: composer test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, there's no functional difference between enumerating all phony targets here or doing so individually. One benefit to the individual approach you're suggesting here is that the attribute is closer to the target definition and we'd be less likely to forget to update this line when adding/removing a phony target down the line. Is that correct?


I'll defer to @alcaeus to chime in here when he returns from PTO, but I actually think this entire Makefile can just be removed. The test target isn't accurate since we actually use vendor/bin/simple-phpunit (as mentioned in CONTRIBUTING.md).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no technical difference, that's right.

However I prefer to have the PHONY next to the target, it makes a cleaner diff and if you copy paste a target, it's more easy to not forget it.

If you prefer to remove the Makefile @alcaeus, I will provide a PR


COMPOSER_ARGS=update --no-interaction --prefer-source

.PHONY: composer
composer:
@command -v composer >/dev/null 2>&1; \
if test $$? -eq 0; then \
Expand All @@ -13,5 +12,6 @@ composer:
false; \
fi

.PHONY: test
test: composer
vendor/bin/phpunit