inflect icon indicating copy to clipboard operation
inflect copied to clipboard

Remove github.com/gobuffalo/envy

Open bep opened this issue 7 years ago • 9 comments

See https://github.com/markbates/inflect/blob/master/name.go#L8

I did a dep ensure -update in Hugo and got some unknown and new packages. I tracked it to the above. That does not look like core inflect functionality. I would appreciate if you could remove/find another way to handle the above.

I will now pin Hugo against an older version of Inflect, but it would be a pity if we miss out on future bug fixes etc.

bep avatar Feb 17 '18 09:02 bep

A PR to remove that dep would be fantastic and welcome.

markbates avatar Feb 17 '18 09:02 markbates

I assume you want to keep the Package method? What is its value?

bep avatar Feb 17 '18 09:02 bep

We would. It’s used in a lot of places to take a path name and turn it into a package name. So /Users/markbates/go/src/foo/bar would become foo/bar or C:\WindowsPath\go\src\etc…

inflect.Name is used very heavily as part of all the Buffalo stuff.

markbates avatar Feb 17 '18 10:02 markbates

We would. It’s used in a lot of places to take a path name and turn it into a package name. So /Users/markbates/go/src/foo/bar would become foo/bar or C:\WindowsPath\go\src\etc…

inflect.Name is used very heavily as part of all the Buffalo stuff.


Mark Bates

On Feb 17, 2018, 9:24 AM +0000, Bjørn Erik Pedersen [email protected], wrote:

I assume you want to keep the Package method? What is its value? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

markbates avatar Feb 17 '18 10:02 markbates

Why not move it to the Buffalo project where it’s used?

bep avatar Feb 17 '18 11:02 bep

It was but it’s been moved here because it’s being used in a lot of projects not just buffalo so it was moved here so there wasn’t a dependency on buffalo everywhere else. The Name type fits here as it provides a way to make uniformed inflections against a name it definitely belongs here, but I agree if the envy dep can be dropped it should.

markbates avatar Feb 17 '18 11:02 markbates

You're stretching the inflect term into a very specific domain here, but this is your project.

One last suggestion from me:

Create package(s), so one can do:

import "github.com/markbates/inflect/name"

name := name.Inflect("some string")

Etc. With the added benefit of a common interface.

bep avatar Feb 17 '18 12:02 bep

The only envy usage I can see there is envy.GoPaths(). It shouldn't be difficult to remove this dep.

stanislas-m avatar Mar 14 '18 16:03 stanislas-m

Made a PR: https://github.com/markbates/inflect/pull/15

robbyoconnor avatar Mar 19 '18 19:03 robbyoconnor