Skip to content
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

composer.json broke by hook setup #41

Closed
sinkcup opened this issue Jan 19, 2019 · 14 comments
Closed

composer.json broke by hook setup #41

sinkcup opened this issue Jan 19, 2019 · 14 comments

Comments

@sinkcup
Copy link

sinkcup commented Jan 19, 2019

  • Hooks Version: v1.0.8
  • Laravel Version: 5.7.19
  • PHP Version: 7.2.10

Description:

composer.json broke by hook setup

Steps To Reproduce:

php artisan hook:setup
git diff composer.json

Error: No newline at end of file

image

@fletch3555
Copy link
Member

Same as the Voyager issue you created... uhhh what?

There's no error in your screenshot

@sinkcup
Copy link
Author

sinkcup commented Jan 19, 2019

Error: No newline at end of file

do you known Git/Linux/Mac demand "every line in text should end with a line break"?

sinkcup added a commit to stonecutter/hooks that referenced this issue Jan 19, 2019
sinkcup added a commit to stonecutter/hooks that referenced this issue Jan 19, 2019
@fletch3555
Copy link
Member

Does it cause you any problems? Thats not a "demand" as much as it is a "standard". If it's not causing problems (which I know its not since 1000's of devs have been using this for over a year), then just ignore it. Or add it back yourself

@sinkcup
Copy link
Author

sinkcup commented Jan 19, 2019

It makes big problem: composer.json be changed for nothing, add rubbish history to git, git warning, code can't commit.

As a programmer, you should follow standards, break rules.

I have fixed it, check the PR.

@fletch3555
Copy link
Member

It doesn't add anything to git, that's on you as the dev. You're welcome to add the line before committing if you so desire. There's no got warning at all, not will it block you from committing other changes.

I'm not saying you (we) shouldn't follow standards. What I am saying is that you're making a huge deal out of nothing

@sinkcup
Copy link
Author

sinkcup commented Jan 19, 2019

There is testing before commit, you known?

Every time I run php artisan voyager:install && phpunit, then composer.json changed, you say it's nothing?

php artisan voyager:install
phpunit #success
git add .
git commit -m 'new a feature'
pre-commit Error: No newline at end of file
git push origin xxx
CI Error: No newline at end of file
Review request changes: Why you delete the line break of `composer.json`? Are U OK?

@fletch3555
Copy link
Member

We have no control over any pre-commit hooks you may have added to your project. There is nothing in the core functionality of git that would block the commit simply for a missing newline at the end of a file. Git simply doesn't care.

@sinkcup
Copy link
Author

sinkcup commented Jan 20, 2019

this install changes composer.json, whatever the content, git care changes.

your bug trouble all developers, every time "change back manually" is not a good idea.

@sinkcup
Copy link
Author

sinkcup commented Jan 24, 2019

@emptynick is anybody there?

@emptynick
Copy link
Collaborator

your bug trouble all developers

You are the first one with troubles because of this

@sinkcup
Copy link
Author

sinkcup commented Jan 24, 2019

ha ha. in any case, a package should not change my composer.json

@emptynick
Copy link
Collaborator

emptynick commented Jan 24, 2019

If you dont want hooks to change your composer.json (what it does when installing/uninstalling hooks), remove it.
There's no other way to include/autoload hooks.

@sinkcup
Copy link
Author

sinkcup commented Jan 24, 2019

I had fix it, check the PR #42

@sinkcup
Copy link
Author

sinkcup commented Jan 25, 2019

bug is bug, small bug is bug too. Don't look for any excuses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants