Cleans up ends of scaffold files

Scaffolding.CodeGen.codegenDir no longer removes the final eol. Input files that
had extra eols have had them removed. With these changes, the generated files
are now more identical to the inputs:

    $ diff foo/LICENSE scaffold/LICENSE.cg
    4c4
    < Copyright 2012, foo. All rights reserved.
    ---
    > Copyright ~year~, ~name~. All rights reserved.

Additionally, initial commits of changes to a new project's files aren't
littered with "\ No newline at end of file". Maybe other people don't have this
problem, but vim auto-adds eols to files that lack them...

    commit ce34468190ea87b91eb3b1a9b7987f40d49cf97e
    Author: Bryan Richter <bryan.richter@gmail.com>
    Date:   Fri Jan 27 22:59:57 2012 -0800

        Adds newlines to files that need em.

     Foundation.hs                           |    2 +-
     Handler/Root.hs                         |    2 +-
     Import.hs                               |    2 +-
     config/models                           |    2 +-
     config/postgresql.yml                   |    2 +-
     config/settings.yml                     |    2 +-
     <and so on>
This commit is contained in:
Bryan Richter 2012-01-31 11:32:06 -08:00
parent c58a938e63
commit a0f8c45b4f
11 changed files with 1 additions and 11 deletions

View File

@ -14,7 +14,7 @@ data Token = VarToken String | LitToken String | EmptyToken
codegenDir :: FilePath -> FilePath -> Q Exp codegenDir :: FilePath -> FilePath -> Q Exp
codegenDir dir fp = do codegenDir dir fp = do
s' <- qRunIO $ L.readFile $ (dir ++ "/" ++ fp ++ ".cg") s' <- qRunIO $ L.readFile $ (dir ++ "/" ++ fp ++ ".cg")
let s = init $ LT.unpack $ LT.decodeUtf8 s' let s = LT.unpack $ LT.decodeUtf8 s'
case parse (many parseToken) s s of case parse (many parseToken) s s of
Left e -> error $ show e Left e -> error $ show e
Right tokens' -> do Right tokens' -> do

View File

@ -1,2 +1 @@
:set -i.:config:dist/build/autogen :set -i.:config:dist/build/autogen

View File

@ -61,4 +61,3 @@ getApplicationDev =
loader = loadConfig (configSettings Development) loader = loadConfig (configSettings Development)
{ csParseExtra = parseExtra { csParseExtra = parseExtra
} }

View File

@ -23,4 +23,3 @@ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -12,4 +12,3 @@ import Database.Persist.Quasi
-- http://www.yesodweb.com/book/persistent/ -- http://www.yesodweb.com/book/persistent/
share [mkPersist ~mkPersistSettings~, mkMigrate "migrateAll"] share [mkPersist ~mkPersistSettings~, mkMigrate "migrateAll"]
$(persistFileWith lowerCaseSettings "config/models") $(persistFileWith lowerCaseSettings "config/models")

View File

@ -68,4 +68,3 @@ parseExtra :: DefaultEnv -> Object -> Parser Extra
parseExtra _ o = Extra parseExtra _ o = Extra
<$> o .: "copyright" <$> o .: "copyright"
<*> o .:? "analytics" <*> o .:? "analytics"

View File

@ -19,4 +19,3 @@ staticSite =
-- Warning: any files added to your static directory during run-time can't be -- Warning: any files added to your static directory during run-time can't be
-- accessed this way. You'll have to use their FilePath or URL to access them. -- accessed this way. You'll have to use their FilePath or URL to access them.
$(staticFiles Settings.staticDir) $(staticFiles Settings.staticDir)

View File

@ -3,4 +3,3 @@ $maybe msg <- mmsg
^{widget} ^{widget}
<footer> <footer>
#{extraCopyright $ appExtra $ settings master} #{extraCopyright $ appExtra $ settings master}

View File

@ -1,4 +1,3 @@
body { body {
font-family: sans-serif; font-family: sans-serif;
} }

View File

@ -1,2 +1 @@
document.getElementById("#{h2id}").innerHTML = "<i>Added from JavaScript.</i>"; document.getElementById("#{h2id}").innerHTML = "<i>Added from JavaScript.</i>";

View File

@ -4,4 +4,3 @@ h1 {
h2##{h2id} { h2##{h2id} {
color: #990 color: #990
} }