hacktivist123 / goignore

A lightweight CLI tool for generating .gitignore file in your project. Built with Go and ❤️
MIT License
29 stars 6 forks source link

[Proposal] Improvement on the layout of the project #38

Open noornee opened 1 year ago

noornee commented 1 year ago

hii @hacktivist123 writing all the logic in a single file (main.go) is fine but as the project keeps expanding, it's gonna be a mess to keep tabs of all that's happening(cluttered). I wanna suggest a change to the layout of this project and i would totally understand if you do not wish to change its current layout. :)

late yesterday, i was looking for a project layout and--

a little backstory the reason why i did this was cause when i first came across this project and i was reading through the detectLanguage logic, i had a minor brain fart for almost 10 seconds because for the love of God, i couldn't see where the extensions variable was coming from. i was looking at the function parameters and i couldn't find extension as a parameter there. the fart left and then it dawned on me that i could just go to the function definition to know where its coming from (i have a keybinding for that) okay i honestly dunno why I'm saying this cos it makes absolutely no sense but this was what made me start thinking of a way to improve the layout...

then i remembered that spf13/cobra has a CLI tool that generates some kind of structure

cobra-cli is a command line program to generate cobra applications and command files. It will bootstrap your application scaffolding to rapidly develop a Cobra-based application. It is the easiest way to incorporate Cobra into your application.

i installed it on my machine and tried generating a cobra application and it looked like something we could consider imitating.

i modified the structure a bit and came up with this

what are your thoughts on this?

goignore_gimp_screenshot

ignore the template files directory and some other missing files, i deleted them so it wouldnt take up all the space for the screenshots

hacktivist123 commented 1 year ago

you have a good point, can you send me a link to the tool?

noornee commented 1 year ago

you have a good point, can you send me a link to the tool?

this is it https://github.com/spf13/cobra#usage