Skip to content

Commit

Permalink
Rename the package to fix-whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
L-TChen committed Oct 14, 2019
1 parent b651f9a commit dd96957
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
15 changes: 8 additions & 7 deletions FixWhitespace.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Liang-Ting Chen 2019-10-13:
-- this program is partially re-written such that
-- the configuration part is controllfed by an external
-- configuration file `fix-agda-whitespace.yaml"
-- configuration file `fix-whitespace.yaml"
-- in the base directory instead.

import Control.Monad
Expand All @@ -23,7 +23,7 @@ import ParseConfig
-- The location of the configuration file.
-- TODO: Add an option to specify a custom location.
defaultLoc :: FilePath
defaultLoc = "fix-agda-whitespace.yaml"
defaultLoc = "fix-whitespace.yaml"

-- Modes.

Expand All @@ -35,10 +35,11 @@ data Mode
main :: IO ()
main = do
args <- getArgs
progName <- getProgName
mode <- case args of
[] -> return Fix
["--check"] -> return Check
_ -> hPutStr stderr usage >> exitFailure
_ -> hPutStr stderr (usage progName) >> exitFailure

Config incDirs excDirs incFiles excFiles <- parseConfig defaultLoc
base <- getCurrentDirectory
Expand All @@ -50,11 +51,11 @@ main = do

-- | Usage info.

usage :: String
usage = unlines
[ "fix-agda-whitespace: Fixes whitespace issues."
usage :: String -> String
usage progName = unlines
[ progName ++ ": Fixes whitespace issues."
, ""
, "Usage: fix-agda-whitespace [--check]"
, "Usage: " ++ progName ++ " [--check]"
, ""
, "This program should be run in the base directory."
, ""
Expand Down
16 changes: 13 additions & 3 deletions fix-agda-whitespace.cabal → fix-whitespace.cabal
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
name: fix-agda-whitespace
name: fix-whitespace
version: 0.0.5
cabal-version: >= 1.8
build-type: Simple
description: Fixes whitespace issues for Agda sources.
description: Removes trailing whitespace, lines containing only whitespace and ensure that every file ends in a newline character.
maintainer: Liang-Ting Chen <[email protected]>
homepage: https://github.com/agda/fix-whitespace
bug-reports: https://github.com/agda/fix-whitespace/issues
author: fix-whitespace was originally rewritten by Nils Anders Danielsson with contributions from Ulf Norell, Andrés Sicard-Ramírez, Andreas Abel, Philipp Hausmann, Jesper Cockx, Vlad Semenov, and Liang-Ting Chen.
Category: Text
Synopsis: Fixes whitespace issues.
tested-with: GHC == 8.0.2
GHC == 8.2.2
GHC == 8.4.4
GHC == 8.6.5

executable fix-agda-whitespace
source-repository head
type: git
location: https://github.com/agda/fix-whitespace.git

executable fix-whitespace
hs-source-dirs: .
main-is: FixWhitespace.hs
other-modules: ParseConfig
Expand Down
2 changes: 1 addition & 1 deletion fix-agda-whitespace.yaml → fix-whitespace.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# fix-agda-whitespace determines the set of directories first and
# fix-whitespace determines the set of directories first and
# then the set of filenames inside those directories.
#
# The extended glob pattern can be used to specify file/direcotory names.
Expand Down

0 comments on commit dd96957

Please sign in to comment.