Skip to content

Commit

Permalink
Merge pull request technomancy#1793 from m00nlight/hgignore
Browse files Browse the repository at this point in the history
Add .hgignore to lein new output
  • Loading branch information
hypirion committed Dec 29, 2014
2 parents 1f324da + 09c8272 commit aace7db
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 15 deletions.
4 changes: 3 additions & 1 deletion resources/leiningen/new/app/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ pom.xml.asc
*.jar
*.class
/.lein-*
/.nrepl-port
/.nrepl-port
.hgignore
.hg/
12 changes: 12 additions & 0 deletions resources/leiningen/new/app/hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax: glob
target/**
classes/**
checkouts/**
pom.xml
pom.xml.asc
*.jar
*.class
/.lein-*
/.nrepl-port
.gitignore
.git/**
4 changes: 3 additions & 1 deletion resources/leiningen/new/default/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ pom.xml.asc
*.jar
*.class
/.lein-*
/.nrepl-port
/.nrepl-port
.hgignore
.hg/
12 changes: 12 additions & 0 deletions resources/leiningen/new/default/hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax: glob
target/**
classes/**
checkouts/**
pom.xml
pom.xml.asc
*.jar
*.class
/.lein-*
/.nrepl-port
.gitignore
.git/**
4 changes: 3 additions & 1 deletion resources/leiningen/new/plugin/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ pom.xml.asc
*.jar
*.class
/.lein-*
/.nrepl-port
/.nrepl-port
.hgignore
.hg/
12 changes: 12 additions & 0 deletions resources/leiningen/new/plugin/hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax: glob
target/**
classes/**
checkouts/**
pom.xml
pom.xml.asc
*.jar
*.class
/.lein-*
/.nrepl-port
.gitignore
.git/**
4 changes: 3 additions & 1 deletion resources/leiningen/new/template/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ pom.xml.asc
*.jar
*.class
/.lein-*
/.nrepl-port
/.nrepl-port
.hgignore
.hg/
12 changes: 12 additions & 0 deletions resources/leiningen/new/template/hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax: glob
target/**
classes/**
checkouts/**
pom.xml
pom.xml.asc
*.jar
*.class
/.lein-*
/.nrepl-port
.gitignore
.git/**
1 change: 1 addition & 0 deletions src/leiningen/new/app.clj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
["README.md" (render "README.md" data)]
["doc/intro.md" (render "intro.md" data)]
[".gitignore" (render "gitignore" data)]
[".hgignore" (render "hgignore" data)]
["src/{{nested-dirs}}.clj" (render "core.clj" data)]
["test/{{nested-dirs}}_test.clj" (render "test.clj" data)]
["LICENSE" (render "LICENSE" data)]
Expand Down
1 change: 1 addition & 0 deletions src/leiningen/new/default.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Accepts a group id in the project name: `lein new foo.bar/baz`"
["README.md" (render "README.md" data)]
["doc/intro.md" (render "intro.md" data)]
[".gitignore" (render "gitignore" data)]
[".hgignore" (render "hgignore" data)]
["src/{{nested-dirs}}.clj" (render "core.clj" data)]
["test/{{nested-dirs}}_test.clj" (render "test.clj" data)]
["LICENSE" (render "LICENSE" data)]
Expand Down
1 change: 1 addition & 0 deletions src/leiningen/new/plugin.clj
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
["project.clj" (render "project.clj" data)]
["README.md" (render "README.md" data)]
[".gitignore" (render "gitignore" data)]
[".hgignore" (render "hgignore" data)]
["src/leiningen/{{sanitized}}.clj" (render "name.clj" data)]
["LICENSE" (render "LICENSE" data)])))
1 change: 1 addition & 0 deletions src/leiningen/new/template.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
["README.md" (render "README.md" data)]
["project.clj" (render "project.clj" data)]
[".gitignore" (render "gitignore" data)]
[".hgignore" (render "hgignore" data)]
["src/leiningen/new/{{sanitized}}.clj" (render "temp.clj" data)]
["resources/leiningen/new/{{sanitized}}/foo.clj" (render "foo.clj")]
["LICENSE" (render "LICENSE" data)])))
22 changes: 11 additions & 11 deletions test/leiningen/test/new.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
(deftest test-new-with-just-project-name
(leiningen.new/new nil "test-new-proj")
(is (= #{"README.md" "project.clj" "resources" "src" "core.clj" "test"
"doc" "intro.md" "test_new_proj" "core_test.clj" ".gitignore"
"LICENSE"}
"doc" "intro.md" "test_new_proj" "core_test.clj" ".gitignore"
".hgignore" "LICENSE"}
(set (map (memfn getName) (rest (file-seq (file "test-new-proj")))))))
(delete-file-recursively (file "test-new-proj") :silently))

(deftest test-new-with-group-and-project-name
(leiningen.new/new nil "orgname/a-project")
(is (= #{"src" "a_project_test.clj" "project.clj" "a_project.clj" "orgname"
"resources" "test" ".gitignore" "README.md" "doc" "intro.md"
"LICENSE"}
"LICENSE" ".hgignore"}
(set (map (memfn getName)
(rest (file-seq (file "a-project")))))))
(delete-file-recursively (file "a-project") :silently))
Expand All @@ -25,30 +25,30 @@
(leiningen.new/new nil "default" "test-new-proj")
(is (= #{"README.md" "project.clj" "src" "core.clj" "test" "resources"
"doc" "intro.md" "test_new_proj" "core_test.clj" ".gitignore"
"LICENSE"}
"LICENSE" ".hgignore"}
(set (map (memfn getName) (rest (file-seq (file "test-new-proj")))))))
(delete-file-recursively (file "test-new-proj") :silently))

(deftest test-new-with-app-template
(leiningen.new/new nil "app" "test-new-app")
(is (= #{"README.md" "project.clj" "src" "core.clj" "test" "resources"
"doc" "intro.md" "test_new_app" "core_test.clj" ".gitignore"
"LICENSE"}
"LICENSE" ".hgignore"}
(set (map (memfn getName) (rest (file-seq (file "test-new-app")))))))
(delete-file-recursively (file "test-new-app") :silently))

(deftest test-new-with-plugin-template
(leiningen.new/new nil "plugin" "test-new-plugin")
(is (= #{"README.md" "project.clj" "src" "leiningen" "test_new_plugin.clj" ".gitignore"
"LICENSE"}
"LICENSE" ".hgignore"}
(set (map (memfn getName) (rest (file-seq (file "test-new-plugin")))))))
(delete-file-recursively (file "test-new-plugin") :silently))

(deftest test-new-with-template-template
(leiningen.new/new nil "template" "test-new-template")
(is (= #{"README.md" "project.clj" "src" "leiningen" "new" "resources"
"test_new_template.clj" "test_new_template" "foo.clj" ".gitignore"
"LICENSE"}
"LICENSE" ".hgignore"}
(set (map (memfn getName) (rest (file-seq (file "test-new-template")))))))
(delete-file-recursively (file "test-new-template") :silently))

Expand Down Expand Up @@ -84,7 +84,7 @@
(leiningen.new/new nil "test-new-proj" "--to-dir" "my-proj")
(is (= #{"README.md" "project.clj" "src" "core.clj" "test" "resources"
"doc" "intro.md" "test_new_proj" "core_test.clj" ".gitignore"
"LICENSE"}
"LICENSE" ".hgignore"}
(set (map (memfn getName) (rest (file-seq (file "my-proj")))))))
(delete-file-recursively (file "my-proj") :silently))

Expand All @@ -93,7 +93,7 @@
(leiningen.new/new nil "test-new-proj" "--force")
(is (= #{"README.md" "project.clj" "src" "core.clj" "test" "resources"
"doc" "intro.md" "test_new_proj" "core_test.clj" ".gitignore"
"LICENSE"}
"LICENSE" ".hgignore"}
(set (map (memfn getName) (rest (file-seq (file "test-new-proj")))))))
(delete-file-recursively (file "test-new-proj") :silently))

Expand All @@ -102,7 +102,7 @@
(leiningen.new/new nil "test-new-proj" "--to-dir" "my-proj" "--force")
(is (= #{"README.md" "project.clj" "src" "core.clj" "test" "resources"
"doc" "intro.md" "test_new_proj" "core_test.clj" ".gitignore"
"LICENSE"}
"LICENSE" ".hgignore"}
(set (map (memfn getName) (rest (file-seq (file "my-proj")))))))
(delete-file-recursively (file "my-proj") :silently))

Expand All @@ -117,7 +117,7 @@
(leiningen.new/new nil "test-new-proj")
(is (= #{"README.md" "project.clj" "src" "core.clj" "test" "resources"
"doc" "intro.md" "test_new_proj" "core_test.clj" ".gitignore"
"LICENSE"}
"LICENSE" ".hgignore"}
(set (map (memfn getName) (rest (file-seq (file new-pwd "test-new-proj")))))))
(System/setProperty "leiningen.original.pwd" original-pwd)
(delete-file-recursively (file new-pwd) :silently)))

0 comments on commit aace7db

Please sign in to comment.