@@ -12,7 +12,6 @@ import Check.Album qualified as Album
1212import Check.Artist qualified as Artist
1313import Check.Track qualified as Track
1414import Config qualified
15- import Data.List.Extra qualified as List
1615import Data.Text qualified as Text
1716import Model.Cover qualified as Cover
1817import Model.Pattern qualified as Pattern
@@ -33,15 +32,13 @@ data Files = Files
3332
3433data CheckOptions = CheckOptions
3534 { chChecks :: Config. Checks ,
36- chFormatting :: Maybe Pattern. Formatting ,
3735 chFilematches :: Maybe Pattern. Pattern
3836 }
3937 deriving (Show )
4038
4139data FixFilePathsOptions = FixFilePathsOptions
4240 { foDryRun :: Bool ,
4341 foBaseDirectory :: Maybe (Path. SomeBase Path. Dir ),
44- foFormatting :: Maybe Pattern. Formatting ,
4542 foPattern :: Maybe Pattern. Pattern
4643 }
4744 deriving (Show )
@@ -65,10 +62,9 @@ checks
6562 config@ (Config. Config {coFilename = Config. Filename {.. }})
6663 (Options. CheckOptions {.. })
6764 | not $ Config. haveChecks chChecks = Config. factorChecks config
68- | otherwise = Config. factorChecks' pattern formatting chChecks
65+ | otherwise = Config. factorChecks' pattern fiFormatting chChecks
6966 where
7067 pattern = fromMaybe fiPattern chFilematches
71- formatting = fromMaybe fiFormatting chFormatting
7268
7369optionsInfo :: Options. ParserInfo Command
7470optionsInfo = Options. info (optionsP <**> Options. helper) Options. idm
@@ -77,7 +73,6 @@ checkOptionsP :: Options.Parser CheckOptions
7773checkOptionsP =
7874 CheckOptions
7975 <$> checksP
80- <*> Options. optional formattingP
8176 <*> Options. optional filematchesP
8277
8378checksP :: Options. Parser Config. Checks
@@ -97,7 +92,6 @@ fixFilePathsOptionsP =
9792 FixFilePathsOptions
9893 <$> dryRunP
9994 <*> optional baseDirectoryP
100- <*> optional formattingP
10195 <*> optional filematchesP
10296
10397dryRunP :: Options. Parser Bool
@@ -243,50 +237,6 @@ filematchesP =
243237 where
244238 parse = Megaparsec. parseMaybe Pattern. parser
245239
246- formattingP :: Options. Parser Pattern. Formatting
247- formattingP =
248- Pattern. Formatting
249- <$> charToCharActionP
250- <*> paddingP " pad track"
251- <*> paddingP " pad disc"
252- <*> Options. option
253- Options. auto
254- ( Options. long " placeholder-max-length"
255- <> Options. metavar " N"
256- <> Options. help
257- " Maximum length of placeholder values after the formatting"
258- )
259-
260- charToCharActionP :: Options. Parser [(Char , Pattern. CharAction )]
261- charToCharActionP =
262- Pattern. addSlashIfNeeded
263- <$> Options. many
264- ( (,Pattern. ChRemove )
265- <$> Options. option
266- Options. auto
267- (Options. long " remove" <> Options. metavar " CHAR" )
268- <|> second Pattern. ChReplace
269- <$> Options. option
270- (Options. eitherReader $ first toString . parse)
271- (Options. long " replace" <> Options. metavar " CHAR:CHAR" )
272- )
273- where
274- parse :: String -> Either Text (Char , Char )
275- parse [c1, ' :' , c2] = Right (c1, c2)
276- parse _ = Left " Must be in the form 'x:y'"
277-
278- paddingP :: String -> Options. Parser Pattern. Padding
279- paddingP label =
280- Options. option
281- (Options. eitherReader $ first toString . Pattern. parsePadding . toText)
282- ( Options. long option
283- <> Options. metavar " N"
284- <> Options. help
285- (" Number of digits to " <> label <> " numbers to" )
286- )
287- where
288- option = List. replace " " " -" label
289-
290240setTagsOptionsP :: Options. Parser SetTagsOptions. SetTagsOptions
291241setTagsOptionsP =
292242 SetTagsOptions. SetTagsOptions
0 commit comments