check-dupes: rename to check-leafnames, per "How to check for errors"

This commit is contained in:
Simon Michael 2020-11-27 12:40:43 -08:00
parent 1b6f8e0b19
commit d330c4910e
9 changed files with 26 additions and 26 deletions

View File

@ -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)
| [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)
| [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)
| [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)

View File

@ -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-dupes, equity, prices, print-unique,
include: check-dates, check-leafnames, 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-dupes - find accounts sharing the same leaf name (Stefano Rodighiero)
- check-leafnames - 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

View File

@ -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.Checkdupes
,module Hledger.Cli.Commands.Checkleafnames
,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.Checkdupes
import Hledger.Cli.Commands.Checkleafnames
import Hledger.Cli.Commands.Close
import Hledger.Cli.Commands.Codes
import Hledger.Cli.Commands.Commodities
@ -110,7 +110,7 @@ builtinCommands = [
,(balancesheetmode , balancesheet)
,(cashflowmode , cashflow)
,(checkdatesmode , checkdates)
,(checkdupesmode , checkdupes)
,(checkleafnamesmode , checkleafnames)
,(closemode , close)
,(codesmode , codes)
,(commoditiesmode , commodities)
@ -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-dupes check for accounts with the same leaf name"
," check-leafnames 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"

View File

@ -1,8 +1,8 @@
{-# LANGUAGE TemplateHaskell #-}
module Hledger.Cli.Commands.Checkdupes (
checkdupesmode
,checkdupes
module Hledger.Cli.Commands.Checkleafnames (
checkleafnamesmode
,checkleafnames
)
where
@ -15,15 +15,15 @@ import Hledger.Cli.CliOptions
import System.Console.CmdArgs.Explicit
import Text.Printf
checkdupesmode :: Mode RawOpts
checkdupesmode = hledgerCommandMode
$(embedFileRelative "Hledger/Cli/Commands/Checkdupes.txt")
checkleafnamesmode :: Mode RawOpts
checkleafnamesmode = hledgerCommandMode
$(embedFileRelative "Hledger/Cli/Commands/Checkleafnames.txt")
[]
[generalflagsgroup1]
hiddenflags
([], Nothing)
checkdupes _opts j = mapM_ render $ checkdupes' $ accountsNames j
checkleafnames _opts j = mapM_ render $ checkleafnames' $ 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
checkdupes' :: (Ord k, Eq k) => [(k, v)] -> [(k, [v])]
checkdupes' l = zip dupLeafs dupAccountNames
checkleafnames' :: (Ord k, Eq k) => [(k, v)] -> [(k, [v])]
checkleafnames' l = zip dupLeafs dupAccountNames
where dupLeafs = map (fst . head) d
dupAccountNames = map (map snd) d
d = dupes' l

View File

@ -1,8 +1,8 @@
check-dupes\
check-leafnames\
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: <http://stefanorodighiero.net/software/hledger-dupes.html>
An example: <http://stefanorodighiero.net/software/hledger-leafnames.html>

View File

@ -4,7 +4,7 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: 4517e1a53a08aa05c53bb06d8591b5591f3ae6f688bf39f809c8f774fbd1d41c
-- hash: a72cc42826939244f2ed9ce667f947ba98a85ac38914cf605de7413ade202776
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/Checkdupes.txt
Hledger/Cli/Commands/Checkleafnames.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.Checkdupes
Hledger.Cli.Commands.Checkleafnames
Hledger.Cli.Commands.Close
Hledger.Cli.Commands.Codes
Hledger.Cli.Commands.Commodities

View File

@ -1620,9 +1620,9 @@ _include_({{Hledger/Cli/Commands/Cashflow.md}})
_include_({{Hledger/Cli/Commands/Checkdates.md}})
## check-dupes
## check-leafnames
_include_({{Hledger/Cli/Commands/Checkdupes.md}})
_include_({{Hledger/Cli/Commands/Checkleafnames.md}})
## close

View File

@ -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/Checkdupes.txt
- Hledger/Cli/Commands/Checkleafnames.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.Checkdupes
- Hledger.Cli.Commands.Checkleafnames
- Hledger.Cli.Commands.Close
- Hledger.Cli.Commands.Codes
- Hledger.Cli.Commands.Commodities