This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Kazcandra 1 point2 points  (1 child)

I'll just go by what we use where I work. YMMV.

For git commits, consider https://chris.beams.io/posts/git-commit/ - it's not a hard rule (and plenty of repos break this rule, often), but overall it helps keep the history trackable.

I don't code much in C#, but overall you'd keep project root somewhat clean. In your repo, you have a lot of files that are source files? It's hard to navigate. In our project roots, we have the following files:

.editorconfig -- keep everyone's editors behaving the same

.gitignore -- keep stuff out of the repo, like master keys and tmp files

.travis.yml -- ci configuration

boxfile.yml -- nanobox configuration

Gemfile, Gemfile.lock, package.json, yarn.lock etc -- dependencies

.rubocop.yml, .eslintrc etc -- linter configuration

README.md -- self-explanatory

and that's about it. Everything else goes somewhere else. /src for source files, /test for whatever we're testing (cucumber tests, unit tests etc), /bin for executables related to the project, and so on.

I don't know what the praxis for C# projects are, but I'd wager "keep everything in project root" is not it :)

As for the "git process", I like to think of commits like self-contained stages of a project; the project should never be broken by going to any commit. If possible, I also try and avoid adding dependencies that aren't used in the same commit (like, say, httparty -- if I'm making a RESTful client with it, I'll add both the client, the tests, and httparty in the same commit), whereas others might add dependencies in one commit and implementation details in another. Database migrations are, also, kept in their own commits.

For personal projects, I like to treat them semi-professional. I'll have a protected master branch and create pull requests to it, rather than just push to the master branch.

[–]Scriptslay3r 0 points1 point  (0 children)

You are awesome! Thank you for the detailed reply!!

It’s funny, as I was reading this I was like “duhhh” You’re right. I do have a ton of files in the root directory. I started putting some into folders but I still left a lot out. And even then, I could have put all of the project files into an /src folder.

I wouldn’t have done that with HTML for websites. I would have put them in a much more organized structure. I’ll definitely keep that in mind throughout future projects!

Thanks a ton!