monterail / guidelines

[DEPRECATED] We are Ruby on Rails experts from Poland. Think hussars. Solid & winged. These are our guidelines.
71 stars 17 forks source link

Include database.sample.yml in new projects #156

Closed teamon closed 11 years ago

teamon commented 11 years ago

For config files that can contain sensitive data put it in .gitignore, add sample file to repository and write about it in README. The file should be named using the following convention:

FILE_NAME.EXT -> FILE_NAME.sample.EXT, so database.yml becomes database.sample.yml. This is better than FILE_NAME.EXT.example because it keeps the file extension in place.

Files that should have samples:

jandudulski commented 11 years ago

This is better than FILE_NAME.EXT.example because it keeps the file extension in place.

Makes sense.

Obvious :+1:

bartoszrega commented 11 years ago

:ok_hand:

sheerun commented 11 years ago

ok

jandudulski commented 11 years ago

:shipit:

sheerun commented 11 years ago

I chnaged my mind. We should include commented code in normal files (like database.yml) and add them to .gitignore

teamon commented 11 years ago

Why? I can't see any reason besides dealing with issues when something wants to parse commented file...

On Sunday, 4 August 2013, Adam Stankiewicz wrote:

I chnaged my mind. We should include commented code in normal files (like database.yml) and add them to .gitignore

— Reply to this email directly or view it on GitHubhttps://github.com/monterail/guidelines/issues/156#issuecomment-22071100 .

sheerun commented 11 years ago

I don't see reason not to. I don't know what you mean by issues with parsing commented file. Comments are part of yml and are parsed normally.

teamon commented 11 years ago

There might be other file formats than yml. And updating example file would be a pain (think about application.yml or even mongoid.yml which includes more options than just user/pass for db)

On Sunday, 4 August 2013, Adam Stankiewicz wrote:

I don't see reason not to. I don't know what you mean by issues with parsing commented file. Comments are part of yml and are parsed normally.

— Reply to this email directly or view it on GitHubhttps://github.com/monterail/guidelines/issues/156#issuecomment-22075240 .

sheerun commented 11 years ago

In your examples there are none. Ruby files can have comments too. I don't see a problem with updates. Even figaro adds commented application.yml and adds it to .gitignore.

teamon commented 11 years ago

If you want to update ignored file, first you have to reset it to the version from repository, then do changes, add with force, commit and then brig back your own changes that you don't want to commit to repository. Where is the advantage over *.sample file?

On Sunday, 4 August 2013, Adam Stankiewicz wrote:

In your examples there are none. Ruby files can have comments too. I don't see a problem with updates. Even figaro adds commented application.yml and adds it to .gitignore.

— Reply to this email directly or view it on GitHubhttps://github.com/monterail/guidelines/issues/156#issuecomment-22076339 .

sheerun commented 11 years ago

I'd do simple merge. In case of *.sample you have to diff file in your mind. Where is the advantage?

sheerun commented 11 years ago

Anyway we can go with sample files for now.

teamon commented 11 years ago

It is exactly the other way around. If you have file X in .gitignore and you have your local modifications in it, when you want to commit a change to that file to repo you have to discard all your local changes, made this on modification and then force add and commit. With X.sample file all you need to do is make a change to that file and do a simple regular commit. Mo merges, no conflicts, no tricks.

On Sunday, 4 August 2013, Adam Stankiewicz wrote:

Anyway we can go with sample files for now.

— Reply to this email directly or view it on GitHubhttps://github.com/monterail/guidelines/issues/156#issuecomment-22076541 .

sheerun commented 11 years ago

I understand what you mean

sheerun commented 11 years ago

I would argue about sample vs example. Imho latter is better (more canonical) although one letter longer.. And the meaning is totally different. After that change I'm all for :shipit:

teamon commented 11 years ago

I'm saying whatever - just keep it consistent across whole project and README

On Sunday, 18 August 2013, Adam Stankiewicz wrote:

I would argue about sample vs example. Imho latter is better (more canonical) although one letter longer.. And the meaning is totally different. After that change I'm all for [image: :shipit:]

— Reply to this email directly or view it on GitHubhttps://github.com/monterail/guidelines/issues/156#issuecomment-22832169 .

jandudulski commented 11 years ago

@teamon :shipit:

chytreg commented 11 years ago

@teamon pls commit and close!