From ee026f5442f085c10014b133413130822538ecc1 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 28 Nov 2020 15:29:36 -0800 Subject: [PATCH] Revert the rename of check-dupes We'll keep the old name, soon to be a hidden command, for compatibility. --- CONTRIBUTING.md | 2 +- hledger/CHANGES.md | 4 ++-- hledger/Hledger/Cli/Commands.hs | 10 +++++----- .../{Checkleafnames.hs => Checkdupes.hs} | 18 +++++++++--------- .../{Checkleafnames.md => Checkdupes.md} | 4 ++-- .../{Checkleafnames.txt => Checkdupes.txt} | 2 +- hledger/hledger.cabal | 6 +++--- hledger/hledger.m4.md | 4 ++-- hledger/package.yaml | 4 ++-- 9 files changed, 27 insertions(+), 27 deletions(-) rename hledger/Hledger/Cli/Commands/{Checkleafnames.hs => Checkdupes.hs} (69%) rename hledger/Hledger/Cli/Commands/{Checkleafnames.md => Checkdupes.md} (70%) rename hledger/Hledger/Cli/Commands/{Checkleafnames.txt => Checkdupes.txt} (94%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5867223eb..0e25de244 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -92,7 +92,7 @@ Syntax: http://www.pandoc.org/MANUAL.html#tables -> pipe_tables | [balancesheet](https://github.com/simonmichael/hledger/issues?q=is:open+label:balancesheet) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:balancesheet) ([good first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:balancesheet)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:balancesheet)/[other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:balancesheet)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:balancesheet) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:balancesheet) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:balancesheet) | [cashflow](https://github.com/simonmichael/hledger/issues?q=is:open+label:cashflow) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:cashflow) ([good first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:cashflow)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:cashflow)/[other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:cashflow)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:cashflow) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:cashflow) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:cashflow) | [checkdates](https://github.com/simonmichael/hledger/issues?q=is:open+label:checkdates) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:checkdates) ([good first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:checkdates)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:checkdates)/[other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:checkdates)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:checkdates) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:checkdates) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:checkdates) -| [checkleafnames](https://github.com/simonmichael/hledger/issues?q=is:open+label:checkleafnames) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:checkleafnames) ([good first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:checkleafnames)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:checkleafnames)/[other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:checkleafnames)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:checkleafnames) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:checkleafnames) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:checkleafnames) +| [checkdupes](https://github.com/simonmichael/hledger/issues?q=is:open+label:checkdupes) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:checkdupes) ([good first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:checkdupes)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:checkdupes)/[other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:checkdupes)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:checkdupes) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:checkdupes) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:checkdupes) | [close](https://github.com/simonmichael/hledger/issues?q=is:open+label:close) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:close) ([good first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:close)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:close)/[other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:close)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:close) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:close) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:close) | [import](https://github.com/simonmichael/hledger/issues?q=is:open+label:import) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:import) ([good first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:import)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:import)/[other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:import)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:import) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:import) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:import) | [incomestatement](https://github.com/simonmichael/hledger/issues?q=is:open+label:incomestatement) | [bugs](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:incomestatement) ([good first](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+label:%22good+first+issue%22+label:incomestatement)/[easy](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+label:easy?+label:incomestatement)/[other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+BUG%22+-label:%22good+first+issue%22+-label:easy?+label:incomestatement)) | [wishes](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+label:%22A+WISH%22+label:incomestatement) | [PRs](https://github.com/simonmichael/hledger/issues?q=is:open+is:pr+label:incomestatement) | [other](https://github.com/simonmichael/hledger/issues?q=is:open+is:issue+-label:%22A+BUG%22+-label:%22A+WISH%22+label:incomestatement) diff --git a/hledger/CHANGES.md b/hledger/CHANGES.md index 1e06f4ac8..10d89f81d 100644 --- a/hledger/CHANGES.md +++ b/hledger/CHANGES.md @@ -1268,7 +1268,7 @@ Migration notes: - new tags command: lists tags in matched transactions - most addons formerly shipped in bin/ are now builtin commands. These - include: check-dates, check-leafnames, equity, prices, print-unique, + include: check-dates, check-dupes, equity, prices, print-unique, register-match, rewrite. - refactor: new Commands module and subdirectory. @@ -1385,7 +1385,7 @@ New addons added/included: - budget - experimental budget reporting command supporting Ledger-like periodic transactions and automated transactions (Mykola Orliuk) - chart - pie-chart-generating prototype, a repackaging of the old hledger-chart tool - check - more powerful balance assertions (Michael Walker) -- check-leafnames - find accounts sharing the same leaf name (Stefano Rodighiero) +- check-dupes - find accounts sharing the same leaf name (Stefano Rodighiero) - prices - show all market price records (Mykola Orliuk) - register-match - a helper for ledger-autosync's deduplication, finds best match for a transaction description diff --git a/hledger/Hledger/Cli/Commands.hs b/hledger/Hledger/Cli/Commands.hs index 25153bf91..73d25eadd 100644 --- a/hledger/Hledger/Cli/Commands.hs +++ b/hledger/Hledger/Cli/Commands.hs @@ -26,7 +26,7 @@ module Hledger.Cli.Commands ( ,module Hledger.Cli.Commands.Balancesheetequity ,module Hledger.Cli.Commands.Cashflow ,module Hledger.Cli.Commands.Checkdates - ,module Hledger.Cli.Commands.Checkleafnames + ,module Hledger.Cli.Commands.Checkdupes ,module Hledger.Cli.Commands.Close ,module Hledger.Cli.Commands.Codes ,module Hledger.Cli.Commands.Commodities @@ -73,7 +73,7 @@ import Hledger.Cli.Commands.Balancesheet import Hledger.Cli.Commands.Balancesheetequity import Hledger.Cli.Commands.Cashflow import Hledger.Cli.Commands.Checkdates -import Hledger.Cli.Commands.Checkleafnames +import Hledger.Cli.Commands.Checkdupes import Hledger.Cli.Commands.Close import Hledger.Cli.Commands.Codes import Hledger.Cli.Commands.Commodities @@ -110,11 +110,11 @@ builtinCommands = [ ,(balancesheetmode , balancesheet) ,(cashflowmode , cashflow) ,(checkdatesmode , checkdates) - ,(checkleafnamesmode , checkleafnames) + ,(checkdupesmode , checkdupes) ,(closemode , close) ,(codesmode , codes) ,(commoditiesmode , commodities) - ,(descriptionsmode , descriptions) + ,(descriptionsmode , descriptions) ,(diffmode , diff) ,(filesmode , files) ,(helpmode , help') @@ -168,7 +168,7 @@ commandsList progversion othercmds = [ ,"+autosync download/deduplicate/convert OFX data" ,"+check check more powerful balance assertions" ," check-dates check transactions are ordered by date" - ," check-leafnames check for accounts with the same leaf name" + ," check-dupes check for accounts with the same leaf name" ," close (equity) generate balance-resetting transactions" ," diff compare account transactions in two journal files" ,"+interest generate interest transactions" diff --git a/hledger/Hledger/Cli/Commands/Checkleafnames.hs b/hledger/Hledger/Cli/Commands/Checkdupes.hs similarity index 69% rename from hledger/Hledger/Cli/Commands/Checkleafnames.hs rename to hledger/Hledger/Cli/Commands/Checkdupes.hs index 48884a868..5a9467b47 100755 --- a/hledger/Hledger/Cli/Commands/Checkleafnames.hs +++ b/hledger/Hledger/Cli/Commands/Checkdupes.hs @@ -1,8 +1,8 @@ {-# LANGUAGE TemplateHaskell #-} -module Hledger.Cli.Commands.Checkleafnames ( - checkleafnamesmode - ,checkleafnames +module Hledger.Cli.Commands.Checkdupes ( + checkdupesmode + ,checkdupes ) where @@ -15,15 +15,15 @@ import Hledger.Cli.CliOptions import System.Console.CmdArgs.Explicit import Text.Printf -checkleafnamesmode :: Mode RawOpts -checkleafnamesmode = hledgerCommandMode - $(embedFileRelative "Hledger/Cli/Commands/Checkleafnames.txt") +checkdupesmode :: Mode RawOpts +checkdupesmode = hledgerCommandMode + $(embedFileRelative "Hledger/Cli/Commands/Checkdupes.txt") [] [generalflagsgroup1] hiddenflags ([], Nothing) -checkleafnames _opts j = mapM_ render $ checkleafnames' $ accountsNames j +checkdupes _opts j = mapM_ render $ checkdupes' $ accountsNames j accountsNames :: Journal -> [(String, AccountName)] accountsNames j = map leafAndAccountName as @@ -31,8 +31,8 @@ accountsNames j = map leafAndAccountName as ps = journalPostings j as = nubSort $ map paccount ps -checkleafnames' :: (Ord k, Eq k) => [(k, v)] -> [(k, [v])] -checkleafnames' l = zip dupLeafs dupAccountNames +checkdupes' :: (Ord k, Eq k) => [(k, v)] -> [(k, [v])] +checkdupes' l = zip dupLeafs dupAccountNames where dupLeafs = map (fst . head) d dupAccountNames = map (map snd) d d = dupes' l diff --git a/hledger/Hledger/Cli/Commands/Checkleafnames.md b/hledger/Hledger/Cli/Commands/Checkdupes.md similarity index 70% rename from hledger/Hledger/Cli/Commands/Checkleafnames.md rename to hledger/Hledger/Cli/Commands/Checkdupes.md index 6b72b7465..c785a9ccf 100644 --- a/hledger/Hledger/Cli/Commands/Checkleafnames.md +++ b/hledger/Hledger/Cli/Commands/Checkdupes.md @@ -1,8 +1,8 @@ -check-leafnames\ +check-dupes\ Reports account names having the same leaf but different prefixes. In other words, two or more leaves that are categorized differently. Reads the default journal file, or another specified as an argument. _FLAGS -An example: +An example: diff --git a/hledger/Hledger/Cli/Commands/Checkleafnames.txt b/hledger/Hledger/Cli/Commands/Checkdupes.txt similarity index 94% rename from hledger/Hledger/Cli/Commands/Checkleafnames.txt rename to hledger/Hledger/Cli/Commands/Checkdupes.txt index af34e3be8..3ed4af0a2 100644 --- a/hledger/Hledger/Cli/Commands/Checkleafnames.txt +++ b/hledger/Hledger/Cli/Commands/Checkdupes.txt @@ -1,4 +1,4 @@ -check-leafnames +check-dupes Reports account names having the same leaf but different prefixes. In other words, two or more leaves that are categorized differently. Reads the default journal file, or another specified as an argument. diff --git a/hledger/hledger.cabal b/hledger/hledger.cabal index c22518278..8cc38b417 100644 --- a/hledger/hledger.cabal +++ b/hledger/hledger.cabal @@ -4,7 +4,7 @@ cabal-version: 1.12 -- -- see: https://github.com/sol/hpack -- --- hash: a72cc42826939244f2ed9ce667f947ba98a85ac38914cf605de7413ade202776 +-- hash: 4517e1a53a08aa05c53bb06d8591b5591f3ae6f688bf39f809c8f774fbd1d41c name: hledger version: 1.19.99 @@ -67,7 +67,7 @@ extra-source-files: Hledger/Cli/Commands/Balancesheetequity.txt Hledger/Cli/Commands/Cashflow.txt Hledger/Cli/Commands/Checkdates.txt - Hledger/Cli/Commands/Checkleafnames.txt + Hledger/Cli/Commands/Checkdupes.txt Hledger/Cli/Commands/Close.txt Hledger/Cli/Commands/Codes.txt Hledger/Cli/Commands/Commodities.txt @@ -123,7 +123,7 @@ library Hledger.Cli.Commands.Balancesheetequity Hledger.Cli.Commands.Cashflow Hledger.Cli.Commands.Checkdates - Hledger.Cli.Commands.Checkleafnames + Hledger.Cli.Commands.Checkdupes Hledger.Cli.Commands.Close Hledger.Cli.Commands.Codes Hledger.Cli.Commands.Commodities diff --git a/hledger/hledger.m4.md b/hledger/hledger.m4.md index 808cc0997..d7820d188 100644 --- a/hledger/hledger.m4.md +++ b/hledger/hledger.m4.md @@ -1622,9 +1622,9 @@ _include_({{Hledger/Cli/Commands/Cashflow.md}}) _include_({{Hledger/Cli/Commands/Checkdates.md}}) -## check-leafnames +## check-dupes -_include_({{Hledger/Cli/Commands/Checkleafnames.md}}) +_include_({{Hledger/Cli/Commands/Checkdupes.md}}) ## close diff --git a/hledger/package.yaml b/hledger/package.yaml index dec9be0ab..457b4a415 100644 --- a/hledger/package.yaml +++ b/hledger/package.yaml @@ -61,7 +61,7 @@ extra-source-files: - Hledger/Cli/Commands/Balancesheetequity.txt - Hledger/Cli/Commands/Cashflow.txt - Hledger/Cli/Commands/Checkdates.txt -- Hledger/Cli/Commands/Checkleafnames.txt +- Hledger/Cli/Commands/Checkdupes.txt - Hledger/Cli/Commands/Close.txt - Hledger/Cli/Commands/Codes.txt - Hledger/Cli/Commands/Commodities.txt @@ -169,7 +169,7 @@ library: - Hledger.Cli.Commands.Balancesheetequity - Hledger.Cli.Commands.Cashflow - Hledger.Cli.Commands.Checkdates - - Hledger.Cli.Commands.Checkleafnames + - Hledger.Cli.Commands.Checkdupes - Hledger.Cli.Commands.Close - Hledger.Cli.Commands.Codes - Hledger.Cli.Commands.Commodities