Use a more conventional spelling for "etags", mostly just use "tags" (#1432)

The previous "ETags" spelling was likely to cause confusion with HTTP ETags:
https://en.wikipedia.org/wiki/HTTP_ETag
This commit is contained in:
Simon Jakobi 2019-10-19 03:59:29 +02:00 committed by mergify[bot]
parent 743d2ab5d6
commit b75962a405
22 changed files with 52 additions and 52 deletions

View File

@ -1,6 +1,6 @@
Next release
* Add `dhall tags` command that build tags file in [ETags](https://en.wikipedia.org/wiki/Ctags#Etags_2) format. Allow to index file or directory.
* Add `dhall tags` command that build tags file in [etags](https://en.wikipedia.org/wiki/Ctags#Etags_2) format. Allow to index file or directory.
1.26.1

View File

@ -369,10 +369,10 @@ Extra-Source-Files:
tests/lint/success/*.dhall
tests/diff/*.dhall
tests/diff/*.txt
tests/etags/*.dhall
tests/etags/*.tags
tests/recursive/*.dhall
tests/regression/*.dhall
tests/tags/*.dhall
tests/tags/*.tags
tests/tutorial/*.dhall
Source-Repository head
@ -490,7 +490,7 @@ Library
Dhall.Core,
Dhall.Crypto,
Dhall.Diff,
Dhall.ETags,
Dhall.Tags,
Dhall.Format,
Dhall.Freeze,
Dhall.Hash,
@ -544,7 +544,7 @@ Test-Suite tasty
Other-Modules:
Dhall.Test.Dhall
Dhall.Test.Diff
Dhall.Test.ETags
Dhall.Test.Tags
Dhall.Test.Format
Dhall.Test.Import
Dhall.Test.Lint

View File

@ -32,5 +32,5 @@ main = do
, prefix </> "src/Dhall.hs"
, prefix </> "src/Dhall/Import.hs"
, prefix </> "src/Dhall/Tutorial.hs"
, prefix </> "src/Dhall/ETags.hs"
, prefix </> "src/Dhall/Tags.hs"
]

View File

@ -65,7 +65,7 @@ import qualified Dhall.Hash
import qualified Dhall.Import
import qualified Dhall.Import.Types
import qualified Dhall.Lint
import qualified Dhall.ETags
import qualified Dhall.Tags
import qualified Dhall.Pretty
import qualified Dhall.Repl
import qualified Dhall.TypeCheck
@ -112,11 +112,12 @@ data Mode
| Hash
| Diff { expr1 :: Text, expr2 :: Text }
| Lint { inplace :: Input }
| ETags { input :: Input
, output :: Output
, suffixes :: Maybe [Text]
, followSymlinks :: Bool
}
| Tags
{ input :: Input
, output :: Output
, suffixes :: Maybe [Text]
, followSymlinks :: Bool
}
| Encode { file :: Input, json :: Bool }
| Decode { file :: Input, json :: Bool }
| Text { file :: Input }
@ -197,8 +198,8 @@ parseMode =
(Lint <$> parseInplace)
<|> subcommand
"tags"
"Generate ETags file"
(ETags <$> parseInput <*> parseTagsOutput <*> parseSuffixes <*> parseFollowSymlinks)
"Generate etags file"
(Tags <$> parseInput <*> parseTagsOutput <*> parseSuffixes <*> parseFollowSymlinks)
<|> subcommand
"format"
"Standard code formatter for the Dhall language"
@ -719,8 +720,8 @@ command (Options {..}) = do
Control.Exception.throwIO (Dhall.InvalidType {..})
ETags {..} -> do
tags <- Dhall.ETags.generate input suffixes followSymlinks
Tags {..} -> do
tags <- Dhall.Tags.generate input suffixes followSymlinks
case output of
OutputFile file ->

View File

@ -4,9 +4,8 @@
-- | This module contains the implementation of the @dhall tags@ command
module Dhall.ETags
( -- * ETags
generate
module Dhall.Tags
( generate
) where
import Control.Exception (handle, SomeException(..))
@ -30,7 +29,7 @@ import qualified Data.Text.IO as TIO
import qualified System.Directory as SD
{-
Documentation for ETags format is not very informative and not very correct.
Documentation for the etags format is not very informative and not very correct.
You can find some documentation here:
https://en.wikipedia.org/wiki/Ctags#Etags_2
and you can also check the source code here:
@ -76,7 +75,7 @@ type LineNumber = Int
type ByteOffset = Int
{-| Generate ETags for Dhall expressions
{-| Generate etags for Dhall expressions
-}
generate
:: Input

View File

@ -5,7 +5,7 @@ import Test.Tasty (TestTree)
import qualified Dhall.Test.Dhall
import qualified Dhall.Test.Diff
import qualified Dhall.Test.ETags
import qualified Dhall.Test.Tags
import qualified Dhall.Test.Format
import qualified Dhall.Test.SemanticHash
import qualified Dhall.Test.Import
@ -36,7 +36,7 @@ getAllTests = do
lintTests <- Dhall.Test.Lint.getTests
etagsTests <- Dhall.Test.ETags.getTests
tagsTests <- Dhall.Test.Tags.getTests
diffTests <- Dhall.Test.Diff.getTests
@ -52,7 +52,7 @@ getAllTests = do
, lintTests
, diffTests
, semanticHashTests
, etagsTests
, tagsTests
, Dhall.Test.Regression.tests
, Dhall.Test.Tutorial.tests
, Dhall.Test.QuickCheck.tests

View File

@ -1,6 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
module Dhall.Test.ETags where
module Dhall.Test.Tags where
import Data.Monoid ((<>))
import Data.Text (Text)
@ -11,30 +11,30 @@ import Turtle (FilePath)
import qualified Data.Text as Text
import qualified Data.Text.IO as Text.IO
import qualified Dhall.ETags as ETags
import qualified Dhall.Tags as Tags
import qualified Dhall.Test.Util as Test.Util
import qualified Test.Tasty as Tasty
import qualified Test.Tasty.HUnit as Tasty.HUnit
import qualified Turtle
etagsDirectory :: FilePath
etagsDirectory = "./tests/etags"
tagsDirectory :: FilePath
tagsDirectory = "./tests/tags"
getTests :: IO TestTree
getTests = do
etagsTests <- Test.Util.discover (Turtle.chars <* ".dhall") etagsTest (Turtle.lstree etagsDirectory)
tagsTests <- Test.Util.discover (Turtle.chars <* ".dhall") tagsTest (Turtle.lstree tagsDirectory)
let testTree = Tasty.testGroup "etags tests" [ etagsTests, etagsDirTest ]
let testTree = Tasty.testGroup "tags tests" [ tagsTests, tagsDirTest ]
return testTree
etagsTest :: Text -> TestTree
etagsTest prefix =
tagsTest :: Text -> TestTree
tagsTest prefix =
Tasty.HUnit.testCase (Text.unpack prefix) $ do
let inputFile = Text.unpack (prefix <> ".dhall")
let outputFile = Text.unpack (prefix <> ".tags")
actualTags <- fixPathSeparators <$> ETags.generate (InputFile inputFile) Nothing False
actualTags <- fixPathSeparators <$> Tags.generate (InputFile inputFile) Nothing False
expectedTags <- Text.IO.readFile outputFile
@ -42,14 +42,14 @@ etagsTest prefix =
Tasty.HUnit.assertEqual message expectedTags actualTags
etagsDirTest :: TestTree
etagsDirTest =
tagsDirTest :: TestTree
tagsDirTest =
Tasty.HUnit.testCase "all" $ do
let outputFile = Text.unpack . Turtle.format Turtle.fp $ etagsDirectory Turtle.</> "all.tags"
let outputFile = Text.unpack . Turtle.format Turtle.fp $ tagsDirectory Turtle.</> "all.tags"
actualTags <- fmap fixPathSeparators
(ETags.generate
(InputFile (Text.unpack . Turtle.format Turtle.fp $ etagsDirectory))
(Tags.generate
(InputFile (Text.unpack . Turtle.format Turtle.fp $ tagsDirectory))
(Just [".dhall"])
False)

View File

@ -1,16 +1,16 @@
./tests/etags/let.dhall,66
./tests/tags/let.dhall,66
let.dhall1,1
/let.dhall1,1
let foo foo1,5
let bar bar3,22
./tests/etags/nonunicode.dhall,63
./tests/tags/nonunicode.dhall,63
nonunicode.dhall1,1
/nonunicode.dhall1,1
let foo foo2,12
./tests/etags/record.dhall,335
./tests/tags/record.dhall,335
record.dhall1,1
/record.dhall1,1
let Config Config6,81
@ -23,7 +23,7 @@ let Config Config6,81
let makeUser makeUser16,323
let configs configs30,804
./tests/etags/recordlit.dhall,223
./tests/tags/recordlit.dhall,223
recordlit.dhall1,1
/recordlit.dhall1,1
{ home home8,143
@ -33,7 +33,7 @@ let configs configs30,804
, name = { firstName firstName11,272
, secondName secondName12,302
./tests/etags/simple.dhall,254
./tests/tags/simple.dhall,254
simple.dhall1,1
/simple.dhall1,1
let generate generate6,100
@ -44,12 +44,12 @@ let Config Config32,880
, privateKey privateKey34,917
, publicKey publicKey35,943
./tests/etags/unicode.dhall,57
./tests/tags/unicode.dhall,57
unicode.dhall1,1
/unicode.dhall1,1
let foo foo2,15
./tests/etags/union.dhall,394
./tests/tags/union.dhall,394
union.dhall1,1
/union.dhall1,1
let Element Element1,5

View File

@ -1,5 +1,5 @@
./tests/etags/let.dhall,66
./tests/tags/let.dhall,66
let.dhall1,1
/let.dhall1,1
let foo foo1,5

View File

@ -1,5 +1,5 @@
./tests/etags/nonunicode.dhall,63
./tests/tags/nonunicode.dhall,63
nonunicode.dhall1,1
/nonunicode.dhall1,1
let foo foo2,12

View File

@ -1,5 +1,5 @@
./tests/etags/record.dhall,335
./tests/tags/record.dhall,335
record.dhall1,1
/record.dhall1,1
let Config Config6,81

View File

@ -1,5 +1,5 @@
./tests/etags/recordlit.dhall,223
./tests/tags/recordlit.dhall,223
recordlit.dhall1,1
/recordlit.dhall1,1
{ home home8,143

View File

@ -1,5 +1,5 @@
./tests/etags/simple.dhall,254
./tests/tags/simple.dhall,254
simple.dhall1,1
/simple.dhall1,1
let generate generate6,100

View File

@ -1,5 +1,5 @@
./tests/etags/unicode.dhall,57
./tests/tags/unicode.dhall,57
unicode.dhall1,1
/unicode.dhall1,1
let foo foo2,15

View File

@ -1,5 +1,5 @@
./tests/etags/union.dhall,394
./tests/tags/union.dhall,394
union.dhall1,1
/union.dhall1,1
let Element Element1,5