foundweekends / foundweekends/giter8

Base output directory should strip non-word characters

Open
#274 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
1.8k
Forks
225
Avg merge
2h 35m
Merged PRs (30d)
8

Description

For example:

```
$ sbt new file:///Users/tmoore/Projects/lagom/lagom-java.g8
[info] Loading global plugins from /Users/tmoore/.sbt/0.13/plugins
[info] Set current project to java (in build file:/Users/tmoore/Projects/tmp/java/)
name [Hello]: Hello, world!
organization [com.example]:
version [1.0-SNAPSHOT]:
lagom_version [1.3.1]:

Template applied in ./hello,-world!
```

I would have expected it to name the directory "hello-world" without the additional punctuation.

This could be fixed one of two ways:

1. Apply the "word-only" format to the "name" parameter [when constructing the base directory](https://github.com/foundweekends/giter8/blob/0.7.x/library/src/main/scala/g8.scala#L257).
2. Apply the "word-only" format to [the "normalize" format itself](https://github.com/foundweekends/giter8/blob/0.7.x/library/src/main/scala/g8.scala#L193) before hyphenating.

I think that the second option makes sense for an intuitive understanding of what "normalize" ought to do, but it might be an unexpected change for some people.

I'm interested in people's thoughts, and I can make a pull request with whatever the consensus is.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.