Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Add .tfignore subgenerator [question] #404

Closed
scottaddie opened this issue Oct 10, 2015 · 8 comments
Closed

Add .tfignore subgenerator [question] #404

scottaddie opened this issue Oct 10, 2015 · 8 comments

Comments

@scottaddie
Copy link
Contributor

Can a .tfignore subgenerator be added to support the TFS crowd? I'd be willing to take this on. Similar to what's being done to create gruntfile.js, I envision there being an option like the following:

yo aspnet --tfs

When the tfs option has been provided, a .tfignore file will be created instead of a .gitignore file. It could ignore the same files and folders being ignored in the .gitignore file.

@peterblazejewicz
Copy link
Member

If we add this option someone will have to keep it in sync with .gitignore use in ASP.NET projects.
That's easy task to watch for .gitignore use in ASP.NET ecosystem I think, as most of things related seem to be on GitHub right now (so we compare contents and exclusions) and there is also: https://github.com/github/gitignore
Is there something similar for TFS when using TFS for source control? (note: I'm using TFS server at work, but I only use it with Git repos)

@willl
Copy link
Member

willl commented Oct 11, 2015

The syntax looks similar to .gitignore, so I imagine that it may be possible to just rename a .gitignore file to be .tfignore? (I imagine that tfignore will ignore any rules that aren't compatible)

Not 100% sure as I have not tested this.

Here's some resources:

@sayedihashimi
Copy link
Member

We're really trying to avoid command line switches like that. The only real reason we implemented that for grunt was that we used to create a grunt file by default.

We are considering an interactive flow where this may make sense #367 (comment)

I'd be supportive of a sub-generator but I'd like to avoid the --tfs flag.

@spboyer
Copy link
Contributor

spboyer commented Oct 11, 2015

Agreed , options for generators are not a good path.

@scottaddie
Copy link
Contributor Author

I totally understand the desire to avoid another command line switch. I'll start working on a .tfignore sub-generator.

In regards to the coding changes, does anyone have tips on how to test this sub-generator (on Windows) once completed? Is there a test script I should be running?

@peterblazejewicz
Copy link
Member

does anyone have tips on how to test this sub-generator (on Windows) once completed? Is there a test script I should be running?

@scottaddie
#1
add test case first so you fail red, modelled after .gitignore:
aspnet/Tooling#215
#2
add subgenerator by creating a folder with subgenerator name, a gitignore is a good example:
https://github.com/OmniSharp/generator-aspnet/tree/master/gitignore
The folder should contain:

  • index.js
  • USAGE (file)

after this running npm test should fail no more (all green)
#3
update main generator USAGE file adding subgenerator (in correct order):
https://github.com/OmniSharp/generator-aspnet/blob/master/app/USAGE
#4
update main project README.md adding subgenerator to existing list and addint a section about it. I usually just copy existing subgenerator section and replace content.
#5
make single PR with single commit branching from master (usual GitHub workflow, nothing fancy in this project)

@scottaddie
Copy link
Contributor Author

@peterblazejewicz Pull request submitted. Thank you for the detailed instructions!

@scottaddie
Copy link
Contributor Author

Closing this issue, as the new sub-generator was merged in and is now available.

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

No branches or pull requests

5 participants