From 9783aa4b30fb9bdf3b7478f38bb58eb7e121658a Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Thu, 6 Oct 2016 15:18:09 -0500 Subject: [PATCH 01/16] Add Import / Export Categories --- src/Category.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Category.hs b/src/Category.hs index 8cb5071ab..57ddf4a21 100644 --- a/src/Category.hs +++ b/src/Category.hs @@ -109,6 +109,10 @@ data Category | MathOperator -- | A module | Module + -- | An import + | Import + -- | An export + | Export deriving (Eq, Generic, Ord, Show) -- Instances @@ -161,6 +165,8 @@ instance Arbitrary Category where , pure Class , pure Method , pure Module + , pure Import + , pure Export , Other <$> arbitrary ] From e10b6f1144cde92c74894499fd7aed97f75074ca Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Thu, 6 Oct 2016 15:19:01 -0500 Subject: [PATCH 02/16] Handle "import_statement" to JavaScript.hs --- src/Language/JavaScript.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Language/JavaScript.hs b/src/Language/JavaScript.hs index 42deb23a6..d8eba9564 100644 --- a/src/Language/JavaScript.hs +++ b/src/Language/JavaScript.hs @@ -67,6 +67,7 @@ termConstructor source sourceSpan name range children ("method_definition", [ identifier, exprs ]) -> S.Method identifier [] (toList (unwrap exprs)) ("class", [ identifier, superclass, definitions ]) -> S.Class identifier (Just superclass) (toList (unwrap definitions)) ("class", [ identifier, definitions ]) -> S.Class identifier Nothing (toList (unwrap definitions)) + ("import_statement", [ statements, identifier ] ) -> S.Import identifier statements _ | name `elem` forStatements, Just (exprs, body) <- unsnoc children -> S.For exprs body _ | name `elem` operators -> S.Operator children _ | name `elem` functions -> case children of @@ -142,6 +143,7 @@ categoryForJavaScriptProductionName name = case name of "comment" -> Comment "bitwise_op" -> BitwiseOperator "rel_op" -> RelationalOperator + "import_statement" -> Import _ -> Other name toVarDecl :: (HasField fields Category) => Term (S.Syntax Text) (Record fields) -> Term (S.Syntax Text) (Record fields) From 63ca53b82809b9be31f7034f183a22cb25f7576d Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Thu, 6 Oct 2016 15:19:11 -0500 Subject: [PATCH 03/16] Add Import Syntax --- src/Syntax.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Syntax.hs b/src/Syntax.hs index d4d6355f4..5c1f44fcc 100644 --- a/src/Syntax.hs +++ b/src/Syntax.hs @@ -74,6 +74,7 @@ data Syntax a f | If f f (Maybe f) -- | A module with an identifier, and a list of syntaxes. | Module { moduleId:: f, moduleBody :: [f] } + | Import f f deriving (Eq, Foldable, Functor, Generic, Generic1, Mergeable, Ord, Show, Traversable) From 6199444e9115de62b92a8f6a5b6d52f2e6584dac Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Thu, 6 Oct 2016 15:19:39 -0500 Subject: [PATCH 04/16] Handle Import Syntax Diff Summaries --- src/DiffSummary.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/DiffSummary.hs b/src/DiffSummary.hs index 250260cd8..aad725e94 100644 --- a/src/DiffSummary.hs +++ b/src/DiffSummary.hs @@ -49,6 +49,7 @@ identifiable term = isIdentifiable (unwrap term) term S.Method{} -> Identifiable S.Leaf{} -> Identifiable S.DoWhile{} -> Identifiable + S.Import{} -> Identifiable _ -> Unidentifiable data DiffInfo = LeafInfo { categoryName :: Text, termName :: Text } @@ -184,6 +185,7 @@ toTermName source term = case unwrap term of S.Comment a -> toCategoryName a S.Commented _ _ -> termNameFromChildren term (toList $ unwrap term) S.Module identifier _ -> toTermName' identifier + S.Import identifier _ -> toTermName' identifier where toTermName' = toTermName source termNameFromChildren term children = termNameFromRange (unionRangesFrom (range term) (range <$> children)) termNameFromSource term = termNameFromRange (range term) @@ -307,6 +309,7 @@ instance HasCategory Category where C.CommaOperator -> "comma operator" C.Empty -> "empty statement" C.Module -> "module statement" + C.Import -> "import statement" instance HasField fields Category => HasCategory (SyntaxTerm leaf fields) where toCategoryName = toCategoryName . category . extract From 3ca3d9f035f2d5694d4ed41b14d5d4bd971eadae Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Thu, 6 Oct 2016 15:46:59 -0500 Subject: [PATCH 05/16] Add Diff Summary support for Export Syntax --- src/DiffSummary.hs | 2 ++ src/Language/JavaScript.hs | 2 ++ src/Syntax.hs | 1 + 3 files changed, 5 insertions(+) diff --git a/src/DiffSummary.hs b/src/DiffSummary.hs index aad725e94..2feb29c44 100644 --- a/src/DiffSummary.hs +++ b/src/DiffSummary.hs @@ -186,6 +186,7 @@ toTermName source term = case unwrap term of S.Commented _ _ -> termNameFromChildren term (toList $ unwrap term) S.Module identifier _ -> toTermName' identifier S.Import identifier _ -> toTermName' identifier + S.Export expr -> intercalate ", " $ termNameFromSource <$> expr where toTermName' = toTermName source termNameFromChildren term children = termNameFromRange (unionRangesFrom (range term) (range <$> children)) termNameFromSource term = termNameFromRange (range term) @@ -310,6 +311,7 @@ instance HasCategory Category where C.Empty -> "empty statement" C.Module -> "module statement" C.Import -> "import statement" + C.Export -> "export statement" instance HasField fields Category => HasCategory (SyntaxTerm leaf fields) where toCategoryName = toCategoryName . category . extract diff --git a/src/Language/JavaScript.hs b/src/Language/JavaScript.hs index d8eba9564..c07798127 100644 --- a/src/Language/JavaScript.hs +++ b/src/Language/JavaScript.hs @@ -68,6 +68,7 @@ termConstructor source sourceSpan name range children ("class", [ identifier, superclass, definitions ]) -> S.Class identifier (Just superclass) (toList (unwrap definitions)) ("class", [ identifier, definitions ]) -> S.Class identifier Nothing (toList (unwrap definitions)) ("import_statement", [ statements, identifier ] ) -> S.Import identifier statements + ("export_statement", [ statements ] ) -> S.Export (toList (unwrap statements)) _ | name `elem` forStatements, Just (exprs, body) <- unsnoc children -> S.For exprs body _ | name `elem` operators -> S.Operator children _ | name `elem` functions -> case children of @@ -144,6 +145,7 @@ categoryForJavaScriptProductionName name = case name of "bitwise_op" -> BitwiseOperator "rel_op" -> RelationalOperator "import_statement" -> Import + "export_statement" -> Export _ -> Other name toVarDecl :: (HasField fields Category) => Term (S.Syntax Text) (Record fields) -> Term (S.Syntax Text) (Record fields) diff --git a/src/Syntax.hs b/src/Syntax.hs index 5c1f44fcc..aa4863ea4 100644 --- a/src/Syntax.hs +++ b/src/Syntax.hs @@ -75,6 +75,7 @@ data Syntax a f -- | A module with an identifier, and a list of syntaxes. | Module { moduleId:: f, moduleBody :: [f] } | Import f f + | Export [f] deriving (Eq, Foldable, Functor, Generic, Generic1, Mergeable, Ord, Show, Traversable) From 818daf19687b3abe550ea73bd34565df9ec2929c Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Thu, 6 Oct 2016 15:47:29 -0500 Subject: [PATCH 06/16] Make Import Syntax an identifier and a list --- src/Language/JavaScript.hs | 3 ++- src/Syntax.hs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Language/JavaScript.hs b/src/Language/JavaScript.hs index c07798127..3ae0964a4 100644 --- a/src/Language/JavaScript.hs +++ b/src/Language/JavaScript.hs @@ -67,7 +67,8 @@ termConstructor source sourceSpan name range children ("method_definition", [ identifier, exprs ]) -> S.Method identifier [] (toList (unwrap exprs)) ("class", [ identifier, superclass, definitions ]) -> S.Class identifier (Just superclass) (toList (unwrap definitions)) ("class", [ identifier, definitions ]) -> S.Class identifier Nothing (toList (unwrap definitions)) - ("import_statement", [ statements, identifier ] ) -> S.Import identifier statements + ("import_statement", [ statements, identifier ] ) -> S.Import identifier (toList (unwrap statements)) + ("import_statement", [ identifier ] ) -> S.Import identifier [] ("export_statement", [ statements ] ) -> S.Export (toList (unwrap statements)) _ | name `elem` forStatements, Just (exprs, body) <- unsnoc children -> S.For exprs body _ | name `elem` operators -> S.Operator children diff --git a/src/Syntax.hs b/src/Syntax.hs index aa4863ea4..bc5a42cc3 100644 --- a/src/Syntax.hs +++ b/src/Syntax.hs @@ -74,7 +74,7 @@ data Syntax a f | If f f (Maybe f) -- | A module with an identifier, and a list of syntaxes. | Module { moduleId:: f, moduleBody :: [f] } - | Import f f + | Import f [f] | Export [f] deriving (Eq, Foldable, Functor, Generic, Generic1, Mergeable, Ord, Show, Traversable) From 7d8988ce214e2c8294cbc18e71d31d5599dd6d21 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Thu, 6 Oct 2016 16:03:06 -0500 Subject: [PATCH 07/16] Some exports have identifiers --- src/DiffSummary.hs | 5 ++--- src/Language/JavaScript.hs | 3 ++- src/Syntax.hs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/DiffSummary.hs b/src/DiffSummary.hs index 2feb29c44..18a3a06dc 100644 --- a/src/DiffSummary.hs +++ b/src/DiffSummary.hs @@ -186,7 +186,8 @@ toTermName source term = case unwrap term of S.Commented _ _ -> termNameFromChildren term (toList $ unwrap term) S.Module identifier _ -> toTermName' identifier S.Import identifier _ -> toTermName' identifier - S.Export expr -> intercalate ", " $ termNameFromSource <$> expr + S.Export Nothing expr -> intercalate ", " $ termNameFromSource <$> expr + S.Export (Just identifier) expr -> (intercalate ", " $ termNameFromSource <$> expr) <> " from " <> toTermName' identifier where toTermName' = toTermName source termNameFromChildren term children = termNameFromRange (unionRangesFrom (range term) (range <$> children)) termNameFromSource term = termNameFromRange (range term) @@ -197,8 +198,6 @@ toTermName source term = case unwrap term of Identifiable arg -> toTermName' arg Unidentifiable _ -> "…" - - parentContexts :: [Either (Category, Text) (Category, Text)] -> Doc parentContexts contexts = hsep $ either identifiableDoc annotatableDoc <$> contexts where diff --git a/src/Language/JavaScript.hs b/src/Language/JavaScript.hs index 3ae0964a4..78b4e0d71 100644 --- a/src/Language/JavaScript.hs +++ b/src/Language/JavaScript.hs @@ -69,7 +69,8 @@ termConstructor source sourceSpan name range children ("class", [ identifier, definitions ]) -> S.Class identifier Nothing (toList (unwrap definitions)) ("import_statement", [ statements, identifier ] ) -> S.Import identifier (toList (unwrap statements)) ("import_statement", [ identifier ] ) -> S.Import identifier [] - ("export_statement", [ statements ] ) -> S.Export (toList (unwrap statements)) + ("export_statement", [ statements ] ) -> S.Export Nothing (toList (unwrap statements)) + ("export_statement", [ statements, identifier] ) -> S.Export (Just identifier) (toList (unwrap statements)) _ | name `elem` forStatements, Just (exprs, body) <- unsnoc children -> S.For exprs body _ | name `elem` operators -> S.Operator children _ | name `elem` functions -> case children of diff --git a/src/Syntax.hs b/src/Syntax.hs index bc5a42cc3..356f79a68 100644 --- a/src/Syntax.hs +++ b/src/Syntax.hs @@ -75,7 +75,7 @@ data Syntax a f -- | A module with an identifier, and a list of syntaxes. | Module { moduleId:: f, moduleBody :: [f] } | Import f [f] - | Export [f] + | Export (Maybe f) [f] deriving (Eq, Foldable, Functor, Generic, Generic1, Mergeable, Ord, Show, Traversable) From f85ee8991aa7c29afe5df0dd42614985db2fbc7b Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Thu, 6 Oct 2016 18:19:54 -0500 Subject: [PATCH 08/16] Properly identify export identifiers from export expressions --- src/DiffSummary.hs | 3 ++- src/Language/JavaScript.hs | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/DiffSummary.hs b/src/DiffSummary.hs index 18a3a06dc..08be04f1e 100644 --- a/src/DiffSummary.hs +++ b/src/DiffSummary.hs @@ -187,7 +187,8 @@ toTermName source term = case unwrap term of S.Module identifier _ -> toTermName' identifier S.Import identifier _ -> toTermName' identifier S.Export Nothing expr -> intercalate ", " $ termNameFromSource <$> expr - S.Export (Just identifier) expr -> (intercalate ", " $ termNameFromSource <$> expr) <> " from " <> toTermName' identifier + S.Export (Just identifier) [] -> toTermName' identifier + S.Export (Just identifier) expr -> (intercalate ", " $ termNameFromSource <$> expr) <> " from " <> toTermName' identifier where toTermName' = toTermName source termNameFromChildren term children = termNameFromRange (unionRangesFrom (range term) (range <$> children)) termNameFromSource term = termNameFromRange (range term) diff --git a/src/Language/JavaScript.hs b/src/Language/JavaScript.hs index 78b4e0d71..d6395425e 100644 --- a/src/Language/JavaScript.hs +++ b/src/Language/JavaScript.hs @@ -69,8 +69,10 @@ termConstructor source sourceSpan name range children ("class", [ identifier, definitions ]) -> S.Class identifier Nothing (toList (unwrap definitions)) ("import_statement", [ statements, identifier ] ) -> S.Import identifier (toList (unwrap statements)) ("import_statement", [ identifier ] ) -> S.Import identifier [] - ("export_statement", [ statements ] ) -> S.Export Nothing (toList (unwrap statements)) ("export_statement", [ statements, identifier] ) -> S.Export (Just identifier) (toList (unwrap statements)) + ("export_statement", [ statements ] ) -> case unwrap statements of + S.Indexed _ -> S.Export Nothing (toList (unwrap statements)) + _ -> S.Export (Just statements) [] _ | name `elem` forStatements, Just (exprs, body) <- unsnoc children -> S.For exprs body _ | name `elem` operators -> S.Operator children _ | name `elem` functions -> case children of From 7b24a6ba22ce4baf39d9db3c557faf37643f8813 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Thu, 6 Oct 2016 18:21:59 -0500 Subject: [PATCH 09/16] Add Import and Export render cases --- src/Renderer/JSON.hs | 2 ++ src/Renderer/Split.hs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Renderer/JSON.hs b/src/Renderer/JSON.hs index a4c9aaa06..73fc83468 100644 --- a/src/Renderer/JSON.hs +++ b/src/Renderer/JSON.hs @@ -101,6 +101,8 @@ termFields info syntax = "range" .= characterRange info : "category" .= category S.Class identifier superclass definitions -> [ "classIdentifier" .= identifier ] <> [ "superclass" .= superclass ] <> [ "definitions" .= definitions ] S.Method identifier params definitions -> [ "methodIdentifier" .= identifier ] <> [ "params" .= params ] <> [ "definitions" .= definitions ] S.Module identifier definitions-> [ "moduleIdentifier" .= identifier ] <> [ "definitions" .= definitions ] + S.Import identifier expr -> [ "importIdentifier" .= identifier ] <> [ "importStatements" .= expr ] + S.Export identifier expr -> [ "exportIdentifier" .= identifier ] <> [ "exportStatements" .= expr ] where childrenFields c = [ "children" .= c ] patchFields :: (KeyValue kv, HasField fields Category, HasField fields Range) => SplitPatch (SyntaxTerm leaf fields) -> [kv] diff --git a/src/Renderer/Split.hs b/src/Renderer/Split.hs index 0f9d27797..bdafadd14 100644 --- a/src/Renderer/Split.hs +++ b/src/Renderer/Split.hs @@ -81,6 +81,8 @@ styleName category = "category-" <> case category of C.CommaOperator -> "comma_operator" Other string -> string C.Module -> "module_statement" + C.Import -> "import_statement" + C.Export -> "export_statement" -- | Pick the class name for a split patch. splitPatchToClassName :: SplitPatch a -> AttributeValue From f01460d6c9e4c4d6b37f2681121b054731482212 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Thu, 6 Oct 2016 18:40:00 -0500 Subject: [PATCH 10/16] Export is Identifiable --- src/DiffSummary.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/DiffSummary.hs b/src/DiffSummary.hs index 08be04f1e..fa2f52fc4 100644 --- a/src/DiffSummary.hs +++ b/src/DiffSummary.hs @@ -50,6 +50,7 @@ identifiable term = isIdentifiable (unwrap term) term S.Leaf{} -> Identifiable S.DoWhile{} -> Identifiable S.Import{} -> Identifiable + S.Export{} -> Identifiable _ -> Unidentifiable data DiffInfo = LeafInfo { categoryName :: Text, termName :: Text } From bbe8b00b3478ea562f0b0dccd142229fb57cbc21 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 7 Oct 2016 10:21:14 -0500 Subject: [PATCH 11/16] ++javascript --- test/corpus/repos/javascript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/corpus/repos/javascript b/test/corpus/repos/javascript index 851fcf30f..fb0641496 160000 --- a/test/corpus/repos/javascript +++ b/test/corpus/repos/javascript @@ -1 +1 @@ -Subproject commit 851fcf30f6f5512f49a59cc7167c684cdf668576 +Subproject commit fb064149615bbed414b5ecaaf882340f43131080 From 4453cd1ad983d7f8d77e6507691fef3a206e9d9e Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 7 Oct 2016 10:26:45 -0500 Subject: [PATCH 12/16] Move javascript diff summary JSON test case files --- .../diff-summaries/javascript/export.json | 255 ++++++++++++++++++ .../diff-summaries/javascript/import.json | 214 +++++++++++++++ 2 files changed, 469 insertions(+) create mode 100644 test/corpus/diff-summaries/javascript/export.json create mode 100644 test/corpus/diff-summaries/javascript/import.json diff --git a/test/corpus/diff-summaries/javascript/export.json b/test/corpus/diff-summaries/javascript/export.json new file mode 100644 index 000000000..f7e9d1d37 --- /dev/null +++ b/test/corpus/diff-summaries/javascript/export.json @@ -0,0 +1,255 @@ +[{ + "testCaseDescription": "javascript-export-insert-test", + "expectedResult": { + "changes": { + "export.js": [ + "Added the 'name1, name2, name3, nameN' export statement", + "Added the 'variable1 as name1, variable2 as name2, nameN' export statement", + "Added the 'name1, name2, nameN' export statement", + "Added the 'name1 = value1, name2 = value2, name3, nameN' export statement", + "Added the 'namedFunction' export statement", + "Added the 'anonymous function' export statement", + "Added the 'name1' export statement", + "Added the 'name1 as default' export statement", + "Added the ''foo'' export statement", + "Added the 'name1, name2, nameN from 'foo'' export statement", + "Added the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement" + ] + }, + "errors": {} + }, + "filePaths": [ + "export.js" + ], + "sha1": "c638621fba68755f220c04aae5e9fa82c12c013c", + "gitDir": "test/corpus/repos/javascript", + "sha2": "b7cdbf98892de1783e4cd9d20c14e5b6e4162394" +} +,{ + "testCaseDescription": "javascript-export-replacement-insert-test", + "expectedResult": { + "changes": { + "export.js": [ + "Added the 'name4, name5, name6, nameZ' export statement", + "Added the 'variable2 as name2, variable3 as name3, nameY' export statement", + "Added the 'name3, name4, nameT' export statement", + "Added the 'name2 = value2, name3 = value3, name4, nameO' export statement", + "Added the 'otherNamedFunction' export statement", + "Added the 'newName1' export statement", + "Added the 'anonymous function' export statement", + "Added the 'name2 as statement' export statement", + "Added the ''baz'' export statement", + "Added the 'name7, name8, nameP from 'buzz'' export statement", + "Added the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement", + "Added the 'name1, name2, name3, nameN' export statement", + "Added the 'variable1 as name1, variable2 as name2, nameN' export statement", + "Added the 'name1, name2, nameN' export statement", + "Added the 'name1 = value1, name2 = value2, name3, nameN' export statement", + "Added the 'namedFunction' export statement", + "Added the 'anonymous function' export statement", + "Added the 'name1' export statement", + "Added the 'name1 as default' export statement", + "Added the ''foo'' export statement", + "Added the 'name1, name2, nameN from 'foo'' export statement", + "Added the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement" + ] + }, + "errors": {} + }, + "filePaths": [ + "export.js" + ], + "sha1": "b7cdbf98892de1783e4cd9d20c14e5b6e4162394", + "gitDir": "test/corpus/repos/javascript", + "sha2": "f9922b615f6400d1335d01888a1886c2d8bc8bf2" +} +,{ + "testCaseDescription": "javascript-export-delete-insert-test", + "expectedResult": { + "changes": { + "export.js": [ + "Replaced the 'name4' identifier with the 'name1' identifier in the name1, name2, name3, nameN export statement", + "Replaced the 'name5' identifier with the 'name2' identifier in the name1, name2, name3, nameN export statement", + "Replaced the 'name6' identifier with the 'name3' identifier in the name1, name2, name3, nameN export statement", + "Replaced the 'nameZ' identifier with the 'nameN' identifier in the name1, name2, name3, nameN export statement", + "Replaced the 'variable2' identifier with the 'variable1' identifier in the variable1 as name1, variable2 as name2, nameN export statement", + "Replaced the 'name2' identifier with the 'name1' identifier in the variable1 as name1, variable2 as name2, nameN export statement", + "Replaced the 'variable3' identifier with the 'variable2' identifier in the variable1 as name1, variable2 as name2, nameN export statement", + "Replaced the 'name3' identifier with the 'name2' identifier in the variable1 as name1, variable2 as name2, nameN export statement", + "Replaced the 'nameY' identifier with the 'nameN' identifier in the variable1 as name1, variable2 as name2, nameN export statement", + "Replaced the 'name3' identifier with the 'name1' identifier in the name1, name2, nameN export statement", + "Replaced the 'name4' identifier with the 'name2' identifier in the name1, name2, nameN export statement", + "Replaced the 'nameT' identifier with the 'nameN' identifier in the name1, name2, nameN export statement", + "Replaced the 'name2' identifier with the 'name1' identifier in the name1 var assignment", + "Replaced the 'value2' identifier with the 'value1' identifier in the name1 var assignment", + "Replaced the 'name3' identifier with the 'name2' identifier in the name2 var assignment", + "Replaced the 'value3' identifier with the 'value2' identifier in the name2 var assignment", + "Replaced the 'name4' identifier with the 'name3' identifier in the name1 = value1, name2 = value2, name3, nameN export statement", + "Replaced the 'nameO' identifier with the 'nameN' identifier in the name1 = value1, name2 = value2, name3, nameN export statement", + "Replaced the 'otherNamedFunction' identifier with the 'namedFunction' identifier in the namedFunction export statement", + "Added the 'anonymous function' export statement", + "Added the 'name1' export statement", + "Added the 'name1 as default' export statement", + "Added the ''foo'' export statement", + "Added the 'name1, name2, nameN from 'foo'' export statement", + "Added the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement", + "Deleted the 'newName1' export statement", + "Deleted the 'anonymous function' export statement", + "Deleted the 'name2 as statement' export statement", + "Deleted the ''baz'' export statement", + "Deleted the 'name7, name8, nameP from 'buzz'' export statement", + "Deleted the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement" + ] + }, + "errors": {} + }, + "filePaths": [ + "export.js" + ], + "sha1": "f9922b615f6400d1335d01888a1886c2d8bc8bf2", + "gitDir": "test/corpus/repos/javascript", + "sha2": "704ba99cc2f452fe4f1eb2e8f2741e9169d8ee20" +} +,{ + "testCaseDescription": "javascript-export-replacement-test", + "expectedResult": { + "changes": { + "export.js": [ + "Replaced the 'name1' identifier with the 'name4' identifier in the name4, name5, name6, nameZ export statement", + "Replaced the 'name2' identifier with the 'name5' identifier in the name4, name5, name6, nameZ export statement", + "Replaced the 'name3' identifier with the 'name6' identifier in the name4, name5, name6, nameZ export statement", + "Replaced the 'nameN' identifier with the 'nameZ' identifier in the name4, name5, name6, nameZ export statement", + "Added the 'variable2 as name2, variable3 as name3, nameY' export statement", + "Added the 'name3, name4, nameT' export statement", + "Added the 'name2 = value2, name3 = value3, name4, nameO' export statement", + "Added the 'otherNamedFunction' export statement", + "Added the 'newName1' export statement", + "Added the 'anonymous function' export statement", + "Added the 'name2 as statement' export statement", + "Added the ''baz'' export statement", + "Added the 'name7, name8, nameP from 'buzz'' export statement", + "Added the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement", + "Deleted the 'variable1 as name1, variable2 as name2, nameN' export statement", + "Deleted the 'name1, name2, nameN' export statement", + "Deleted the 'name1 = value1, name2 = value2, name3, nameN' export statement", + "Deleted the 'namedFunction' export statement", + "Deleted the 'anonymous function' export statement", + "Deleted the 'name1' export statement", + "Deleted the 'name1 as default' export statement", + "Deleted the ''foo'' export statement", + "Deleted the 'name1, name2, nameN from 'foo'' export statement", + "Deleted the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement" + ] + }, + "errors": {} + }, + "filePaths": [ + "export.js" + ], + "sha1": "704ba99cc2f452fe4f1eb2e8f2741e9169d8ee20", + "gitDir": "test/corpus/repos/javascript", + "sha2": "9382cc83e945c2651b24d614a19b55bc0f0d7c98" +} +,{ + "testCaseDescription": "javascript-export-delete-replacement-test", + "expectedResult": { + "changes": { + "export.js": [ + "Deleted the 'name4, name5, name6, nameZ' export statement", + "Deleted the 'variable2 as name2, variable3 as name3, nameY' export statement", + "Deleted the 'name3, name4, nameT' export statement", + "Deleted the 'name2 = value2, name3 = value3, name4, nameO' export statement", + "Deleted the 'otherNamedFunction' export statement", + "Deleted the 'newName1' export statement", + "Deleted the 'anonymous function' export statement", + "Deleted the 'name2 as statement' export statement", + "Deleted the ''baz'' export statement", + "Deleted the 'name7, name8, nameP from 'buzz'' export statement", + "Deleted the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement", + "Deleted the 'name1, name2, name3, nameN' export statement", + "Deleted the 'variable1 as name1, variable2 as name2, nameN' export statement", + "Deleted the 'name1, name2, nameN' export statement", + "Deleted the 'name1 = value1, name2 = value2, name3, nameN' export statement", + "Deleted the 'namedFunction' export statement", + "Deleted the 'anonymous function' export statement", + "Deleted the 'name1' export statement", + "Deleted the 'name1 as default' export statement", + "Deleted the ''foo'' export statement", + "Deleted the 'name1, name2, nameN from 'foo'' export statement", + "Deleted the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement", + "Added the 'name4, name5, name6, nameZ' export statement", + "Added the 'variable2 as name2, variable3 as name3, nameY' export statement", + "Added the 'name3, name4, nameT' export statement", + "Added the 'name2 = value2, name3 = value3, name4, nameO' export statement", + "Added the 'otherNamedFunction' export statement", + "Added the 'newName1' export statement", + "Added the 'anonymous function' export statement", + "Added the 'name2 as statement' export statement", + "Added the ''baz'' export statement", + "Added the 'name7, name8, nameP from 'buzz'' export statement", + "Added the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement" + ] + }, + "errors": {} + }, + "filePaths": [ + "export.js" + ], + "sha1": "9382cc83e945c2651b24d614a19b55bc0f0d7c98", + "gitDir": "test/corpus/repos/javascript", + "sha2": "06627b404ed1e8282d55b0be883e00b3f544a64a" +} +,{ + "testCaseDescription": "javascript-export-delete-test", + "expectedResult": { + "changes": { + "export.js": [ + "Deleted the 'name1, name2, name3, nameN' export statement", + "Deleted the 'variable1 as name1, variable2 as name2, nameN' export statement", + "Deleted the 'name1, name2, nameN' export statement", + "Deleted the 'name1 = value1, name2 = value2, name3, nameN' export statement", + "Deleted the 'namedFunction' export statement", + "Deleted the 'anonymous function' export statement", + "Deleted the 'name1' export statement", + "Deleted the 'name1 as default' export statement", + "Deleted the ''foo'' export statement", + "Deleted the 'name1, name2, nameN from 'foo'' export statement", + "Deleted the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement" + ] + }, + "errors": {} + }, + "filePaths": [ + "export.js" + ], + "sha1": "06627b404ed1e8282d55b0be883e00b3f544a64a", + "gitDir": "test/corpus/repos/javascript", + "sha2": "91ba0af4297ddc15593bdd91e34fff7473716e65" +} +,{ + "testCaseDescription": "javascript-export-delete-rest-test", + "expectedResult": { + "changes": { + "export.js": [ + "Deleted the 'name4, name5, name6, nameZ' export statement", + "Deleted the 'variable2 as name2, variable3 as name3, nameY' export statement", + "Deleted the 'name3, name4, nameT' export statement", + "Deleted the 'name2 = value2, name3 = value3, name4, nameO' export statement", + "Deleted the 'otherNamedFunction' export statement", + "Deleted the 'newName1' export statement", + "Deleted the 'anonymous function' export statement", + "Deleted the 'name2 as statement' export statement", + "Deleted the ''baz'' export statement", + "Deleted the 'name7, name8, nameP from 'buzz'' export statement", + "Deleted the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement" + ] + }, + "errors": {} + }, + "filePaths": [ + "export.js" + ], + "sha1": "91ba0af4297ddc15593bdd91e34fff7473716e65", + "gitDir": "test/corpus/repos/javascript", + "sha2": "fb064149615bbed414b5ecaaf882340f43131080" +}] diff --git a/test/corpus/diff-summaries/javascript/import.json b/test/corpus/diff-summaries/javascript/import.json new file mode 100644 index 000000000..9bcdca7fb --- /dev/null +++ b/test/corpus/diff-summaries/javascript/import.json @@ -0,0 +1,214 @@ +[{ + "testCaseDescription": "javascript-import-insert-test", + "expectedResult": { + "changes": { + "import.js": [ + "Added the '\"foo\"' import statement", + "Added the '\"aardvark\"' import statement", + "Added the '\"ant\"' import statement", + "Added the '\"antelope\"' import statement", + "Added the '\"ant-eater\"' import statement", + "Added the '\"anaconda\"' import statement", + "Added the '\"alligator\"' import statement", + "Added the '\"arctic-tern\"' import statement" + ] + }, + "errors": {} + }, + "filePaths": [ + "import.js" + ], + "sha1": "d685b3cf57cbdd7f8768efbd4ec03fc5d81b4241", + "gitDir": "test/corpus/repos/javascript", + "sha2": "34c225bdf15010b290062b5ddab51cbcfc71b543" +} +,{ + "testCaseDescription": "javascript-import-replacement-insert-test", + "expectedResult": { + "changes": { + "import.js": [ + "Added the '\"babirusa\"' import statement", + "Added the '\"baboon\"' import statement", + "Added the '\"badger\"' import statement", + "Added the '\"bald-eagle\"' import statement", + "Added the '\"bandicoot\"' import statement", + "Added the '\"banteng\"' import statement", + "Added the '\"barbet\"' import statement", + "Added the '\"basilisk\"' import statement", + "Added the '\"foo\"' import statement", + "Added the '\"aardvark\"' import statement", + "Added the '\"ant\"' import statement", + "Added the '\"antelope\"' import statement", + "Added the '\"ant-eater\"' import statement", + "Added the '\"anaconda\"' import statement", + "Added the '\"alligator\"' import statement", + "Added the '\"arctic-tern\"' import statement" + ] + }, + "errors": {} + }, + "filePaths": [ + "import.js" + ], + "sha1": "34c225bdf15010b290062b5ddab51cbcfc71b543", + "gitDir": "test/corpus/repos/javascript", + "sha2": "41b25e26f3d0aaa9dd1ada3a2eb2cbacfbe7c039" +} +,{ + "testCaseDescription": "javascript-import-delete-insert-test", + "expectedResult": { + "changes": { + "import.js": [ + "Replaced the \"babirusa\" string with the \"foo\" string in the \"foo\" import statement", + "Replaced the \"baboon\" string with the \"aardvark\" string in the \"aardvark\" import statement", + "Replaced the 'otherName' identifier with the 'name' identifier in the \"aardvark\" import statement", + "Replaced the \"badger\" string with the \"ant\" string in the \"ant\" import statement", + "Replaced the 'element' identifier with the 'member' identifier in the \"ant\" import statement", + "Replaced the \"bald-eagle\" string with the \"antelope\" string in the \"antelope\" import statement", + "Replaced the 'element1' identifier with the 'member1' identifier in the \"antelope\" import statement", + "Replaced the 'element2' identifier with the 'member2' identifier in the \"antelope\" import statement", + "Replaced the \"bandicoot\" string with the \"ant-eater\" string in the \"ant-eater\" import statement", + "Replaced the 'element1' identifier with the 'member1' identifier in the \"ant-eater\" import statement", + "Replaced the 'element2' identifier with the 'member2' identifier in the \"ant-eater\" import statement", + "Replaced the 'elementAlias2' identifier with the 'alias2' identifier in the \"ant-eater\" import statement", + "Replaced the \"banteng\" string with the \"anaconda\" string in the \"anaconda\" import statement", + "Replaced the 'element1' identifier with the 'member1' identifier in the \"anaconda\" import statement", + "Replaced the 'element2' identifier with the 'member2' identifier in the \"anaconda\" import statement", + "Replaced the 'elementAlias2' identifier with the 'alias2' identifier in the \"anaconda\" import statement", + "Replaced the \"barbet\" string with the \"alligator\" string in the \"alligator\" import statement", + "Replaced the 'element' identifier with the 'name' identifier in the \"alligator\" import statement", + "Replaced the \"basilisk\" string with the \"arctic-tern\" string in the \"arctic-tern\" import statement" + ] + }, + "errors": {} + }, + "filePaths": [ + "import.js" + ], + "sha1": "41b25e26f3d0aaa9dd1ada3a2eb2cbacfbe7c039", + "gitDir": "test/corpus/repos/javascript", + "sha2": "a56cabf5afa66506c328a089ca529c04835a0571" +} +,{ + "testCaseDescription": "javascript-import-replacement-test", + "expectedResult": { + "changes": { + "import.js": [ + "Replaced the \"foo\" string with the \"babirusa\" string in the \"babirusa\" import statement", + "Replaced the \"aardvark\" string with the \"baboon\" string in the \"baboon\" import statement", + "Replaced the 'name' identifier with the 'otherName' identifier in the \"baboon\" import statement", + "Replaced the \"ant\" string with the \"badger\" string in the \"badger\" import statement", + "Replaced the 'member' identifier with the 'element' identifier in the \"badger\" import statement", + "Replaced the \"antelope\" string with the \"bald-eagle\" string in the \"bald-eagle\" import statement", + "Replaced the 'member1' identifier with the 'element1' identifier in the \"bald-eagle\" import statement", + "Replaced the 'member2' identifier with the 'element2' identifier in the \"bald-eagle\" import statement", + "Replaced the \"ant-eater\" string with the \"bandicoot\" string in the \"bandicoot\" import statement", + "Replaced the 'member1' identifier with the 'element1' identifier in the \"bandicoot\" import statement", + "Replaced the 'member2' identifier with the 'element2' identifier in the \"bandicoot\" import statement", + "Replaced the 'alias2' identifier with the 'elementAlias2' identifier in the \"bandicoot\" import statement", + "Replaced the \"anaconda\" string with the \"banteng\" string in the \"banteng\" import statement", + "Replaced the 'member1' identifier with the 'element1' identifier in the \"banteng\" import statement", + "Replaced the 'member2' identifier with the 'element2' identifier in the \"banteng\" import statement", + "Replaced the 'alias2' identifier with the 'elementAlias2' identifier in the \"banteng\" import statement", + "Replaced the \"alligator\" string with the \"barbet\" string in the \"barbet\" import statement", + "Replaced the 'name' identifier with the 'element' identifier in the \"barbet\" import statement", + "Replaced the \"arctic-tern\" string with the \"basilisk\" string in the \"basilisk\" import statement" + ] + }, + "errors": {} + }, + "filePaths": [ + "import.js" + ], + "sha1": "a56cabf5afa66506c328a089ca529c04835a0571", + "gitDir": "test/corpus/repos/javascript", + "sha2": "c17186c7d0c948ecedf696bd0e87bf2cc14ebccf" +} +,{ + "testCaseDescription": "javascript-import-delete-replacement-test", + "expectedResult": { + "changes": { + "import.js": [ + "Deleted the '\"babirusa\"' import statement", + "Deleted the '\"baboon\"' import statement", + "Deleted the '\"badger\"' import statement", + "Deleted the '\"bald-eagle\"' import statement", + "Deleted the '\"bandicoot\"' import statement", + "Deleted the '\"banteng\"' import statement", + "Deleted the '\"barbet\"' import statement", + "Deleted the '\"basilisk\"' import statement", + "Deleted the '\"foo\"' import statement", + "Deleted the '\"aardvark\"' import statement", + "Deleted the '\"ant\"' import statement", + "Deleted the '\"antelope\"' import statement", + "Deleted the '\"ant-eater\"' import statement", + "Deleted the '\"anaconda\"' import statement", + "Deleted the '\"alligator\"' import statement", + "Deleted the '\"arctic-tern\"' import statement", + "Added the '\"babirusa\"' import statement", + "Added the '\"baboon\"' import statement", + "Added the '\"badger\"' import statement", + "Added the '\"bald-eagle\"' import statement", + "Added the '\"bandicoot\"' import statement", + "Added the '\"banteng\"' import statement", + "Added the '\"barbet\"' import statement", + "Added the '\"basilisk\"' import statement" + ] + }, + "errors": {} + }, + "filePaths": [ + "import.js" + ], + "sha1": "c17186c7d0c948ecedf696bd0e87bf2cc14ebccf", + "gitDir": "test/corpus/repos/javascript", + "sha2": "621344d7e9aae96986e974fa4dcc62687751ed15" +} +,{ + "testCaseDescription": "javascript-import-delete-test", + "expectedResult": { + "changes": { + "import.js": [ + "Deleted the '\"foo\"' import statement", + "Deleted the '\"aardvark\"' import statement", + "Deleted the '\"ant\"' import statement", + "Deleted the '\"antelope\"' import statement", + "Deleted the '\"ant-eater\"' import statement", + "Deleted the '\"anaconda\"' import statement", + "Deleted the '\"alligator\"' import statement", + "Deleted the '\"arctic-tern\"' import statement" + ] + }, + "errors": {} + }, + "filePaths": [ + "import.js" + ], + "sha1": "621344d7e9aae96986e974fa4dcc62687751ed15", + "gitDir": "test/corpus/repos/javascript", + "sha2": "c051b67ebe0d99d2c487b81603748f63a62a4d8b" +} +,{ + "testCaseDescription": "javascript-import-delete-rest-test", + "expectedResult": { + "changes": { + "import.js": [ + "Deleted the '\"babirusa\"' import statement", + "Deleted the '\"baboon\"' import statement", + "Deleted the '\"badger\"' import statement", + "Deleted the '\"bald-eagle\"' import statement", + "Deleted the '\"bandicoot\"' import statement", + "Deleted the '\"banteng\"' import statement", + "Deleted the '\"barbet\"' import statement", + "Deleted the '\"basilisk\"' import statement" + ] + }, + "errors": {} + }, + "filePaths": [ + "import.js" + ], + "sha1": "c051b67ebe0d99d2c487b81603748f63a62a4d8b", + "gitDir": "test/corpus/repos/javascript", + "sha2": "c638621fba68755f220c04aae5e9fa82c12c013c" +}] From 7c6a849526c97d2d02dc08008cbdc1df11dd4d2d Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Fri, 7 Oct 2016 12:37:31 -0700 Subject: [PATCH 13/16] Notes from weekly --- weekly/2016-10-07.md | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 weekly/2016-10-07.md diff --git a/weekly/2016-10-07.md b/weekly/2016-10-07.md new file mode 100644 index 000000000..919416288 --- /dev/null +++ b/weekly/2016-10-07.md @@ -0,0 +1,48 @@ +# Oct 7th, 2016 + +## What went well? + +@tclem +- productive week! Fixed lots of little bugs, project reorg finished +- Sorted out a variety of dotcom issues +- Tracking latest tree-sitter again + +@rewinfrey +- getting out annotated nested parent context. Thanks @joshvera! +- import/export syntax (new stuff, personally rewarding) + +@joshvera +- happy with all the PRs that got merged in this week +- pairing went well this week (time well spent to unblock people) + +## What were the challenges? + +@tclem +- not getting to do Haskell book (too heads down on other stuff) +- dotcom deploys hard with env var changes (need work here) + +@rewinfrey +- translating tree sitter productions for import/export syntax. How to de-structure stuff correctly. + +@joshvera +- not a lot to report that didn't go well! +- would like to have more design conversations at beginning of week +- lost track a little bit on where progressive diff and related projects are + +all +- a bit hard to track various teams + +## What did you learn? + +@tclem +- how tree-sitter works. the base library, the node compiler, each of the grammars. + +@rewinfrey +- api difference between named nodes in tree-sitter +- better understanding of how we tie into tree-sitter API via the FFI + +@joshvera +- tree-sitter APIs that we aren't using +- split diff output is slow! +- about measures of probability distributions that are multi-dimensional +- difference between variance and volatility From 9a3fccc1e1ed6205a34a91c605c31d77b75f3a49 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 7 Oct 2016 15:58:51 -0500 Subject: [PATCH 14/16] Update tests --- .../diff-summaries/javascript/export.json | 82 +++++++++++-------- .../diff-summaries/javascript/import.json | 28 +++---- test/corpus/repos/javascript | 2 +- 3 files changed, 62 insertions(+), 50 deletions(-) diff --git a/test/corpus/diff-summaries/javascript/export.json b/test/corpus/diff-summaries/javascript/export.json index f7e9d1d37..9807cec04 100644 --- a/test/corpus/diff-summaries/javascript/export.json +++ b/test/corpus/diff-summaries/javascript/export.json @@ -8,12 +8,13 @@ "Added the 'name1, name2, nameN' export statement", "Added the 'name1 = value1, name2 = value2, name3, nameN' export statement", "Added the 'namedFunction' export statement", - "Added the 'anonymous function' export statement", + "Added the 'anonymous() function' export statement", "Added the 'name1' export statement", "Added the 'name1 as default' export statement", "Added the ''foo'' export statement", "Added the 'name1, name2, nameN from 'foo'' export statement", - "Added the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement" + "Added the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement", + "Added the ''foo'' export statement" ] }, "errors": {} @@ -21,9 +22,9 @@ "filePaths": [ "export.js" ], - "sha1": "c638621fba68755f220c04aae5e9fa82c12c013c", + "sha1": "0b6e5350df06e21bab5f8f51a2c41fd12627497f", "gitDir": "test/corpus/repos/javascript", - "sha2": "b7cdbf98892de1783e4cd9d20c14e5b6e4162394" + "sha2": "8237fd20919d59edf776e9ba46aa5615d4d9c923" } ,{ "testCaseDescription": "javascript-export-replacement-insert-test", @@ -36,22 +37,24 @@ "Added the 'name2 = value2, name3 = value3, name4, nameO' export statement", "Added the 'otherNamedFunction' export statement", "Added the 'newName1' export statement", - "Added the 'anonymous function' export statement", + "Added the 'anonymous() function' export statement", "Added the 'name2 as statement' export statement", "Added the ''baz'' export statement", "Added the 'name7, name8, nameP from 'buzz'' export statement", "Added the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement", + "Added the ''fuzz'' export statement", "Added the 'name1, name2, name3, nameN' export statement", "Added the 'variable1 as name1, variable2 as name2, nameN' export statement", "Added the 'name1, name2, nameN' export statement", "Added the 'name1 = value1, name2 = value2, name3, nameN' export statement", "Added the 'namedFunction' export statement", - "Added the 'anonymous function' export statement", + "Added the 'anonymous() function' export statement", "Added the 'name1' export statement", "Added the 'name1 as default' export statement", "Added the ''foo'' export statement", "Added the 'name1, name2, nameN from 'foo'' export statement", - "Added the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement" + "Added the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement", + "Added the ''foo'' export statement" ] }, "errors": {} @@ -59,9 +62,9 @@ "filePaths": [ "export.js" ], - "sha1": "b7cdbf98892de1783e4cd9d20c14e5b6e4162394", + "sha1": "8237fd20919d59edf776e9ba46aa5615d4d9c923", "gitDir": "test/corpus/repos/javascript", - "sha2": "f9922b615f6400d1335d01888a1886c2d8bc8bf2" + "sha2": "96b3e68587f823137392118b1bb6f2442af92d0e" } ,{ "testCaseDescription": "javascript-export-delete-insert-test", @@ -86,19 +89,21 @@ "Replaced the 'value3' identifier with the 'value2' identifier in the name2 var assignment", "Replaced the 'name4' identifier with the 'name3' identifier in the name1 = value1, name2 = value2, name3, nameN export statement", "Replaced the 'nameO' identifier with the 'nameN' identifier in the name1 = value1, name2 = value2, name3, nameN export statement", - "Replaced the 'otherNamedFunction' identifier with the 'namedFunction' identifier in the namedFunction export statement", - "Added the 'anonymous function' export statement", + "Added the 'namedFunction' export statement", + "Added the 'anonymous() function' export statement", "Added the 'name1' export statement", "Added the 'name1 as default' export statement", - "Added the ''foo'' export statement", + "Replaced the 'otherNamedFunction' export statement with the ''foo'' export statement", "Added the 'name1, name2, nameN from 'foo'' export statement", "Added the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement", + "Added the ''foo'' export statement", "Deleted the 'newName1' export statement", - "Deleted the 'anonymous function' export statement", + "Deleted the 'anonymous() function' export statement", "Deleted the 'name2 as statement' export statement", "Deleted the ''baz'' export statement", "Deleted the 'name7, name8, nameP from 'buzz'' export statement", - "Deleted the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement" + "Deleted the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement", + "Deleted the ''fuzz'' export statement" ] }, "errors": {} @@ -106,9 +111,9 @@ "filePaths": [ "export.js" ], - "sha1": "f9922b615f6400d1335d01888a1886c2d8bc8bf2", + "sha1": "96b3e68587f823137392118b1bb6f2442af92d0e", "gitDir": "test/corpus/repos/javascript", - "sha2": "704ba99cc2f452fe4f1eb2e8f2741e9169d8ee20" + "sha2": "9ba7428803482b02837ac9dc033c1fe18e655975" } ,{ "testCaseDescription": "javascript-export-replacement-test", @@ -124,21 +129,23 @@ "Added the 'name2 = value2, name3 = value3, name4, nameO' export statement", "Added the 'otherNamedFunction' export statement", "Added the 'newName1' export statement", - "Added the 'anonymous function' export statement", + "Added the 'anonymous() function' export statement", "Added the 'name2 as statement' export statement", "Added the ''baz'' export statement", "Added the 'name7, name8, nameP from 'buzz'' export statement", "Added the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement", + "Added the ''fuzz'' export statement", "Deleted the 'variable1 as name1, variable2 as name2, nameN' export statement", "Deleted the 'name1, name2, nameN' export statement", "Deleted the 'name1 = value1, name2 = value2, name3, nameN' export statement", "Deleted the 'namedFunction' export statement", - "Deleted the 'anonymous function' export statement", + "Deleted the 'anonymous() function' export statement", "Deleted the 'name1' export statement", "Deleted the 'name1 as default' export statement", "Deleted the ''foo'' export statement", "Deleted the 'name1, name2, nameN from 'foo'' export statement", - "Deleted the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement" + "Deleted the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement", + "Deleted the ''foo'' export statement" ] }, "errors": {} @@ -146,9 +153,9 @@ "filePaths": [ "export.js" ], - "sha1": "704ba99cc2f452fe4f1eb2e8f2741e9169d8ee20", + "sha1": "9ba7428803482b02837ac9dc033c1fe18e655975", "gitDir": "test/corpus/repos/javascript", - "sha2": "9382cc83e945c2651b24d614a19b55bc0f0d7c98" + "sha2": "a5a2156bcfc567018bf1295f403bc508694e1f06" } ,{ "testCaseDescription": "javascript-export-delete-replacement-test", @@ -161,33 +168,36 @@ "Deleted the 'name2 = value2, name3 = value3, name4, nameO' export statement", "Deleted the 'otherNamedFunction' export statement", "Deleted the 'newName1' export statement", - "Deleted the 'anonymous function' export statement", + "Deleted the 'anonymous() function' export statement", "Deleted the 'name2 as statement' export statement", "Deleted the ''baz'' export statement", "Deleted the 'name7, name8, nameP from 'buzz'' export statement", "Deleted the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement", + "Deleted the ''fuzz'' export statement", "Deleted the 'name1, name2, name3, nameN' export statement", "Deleted the 'variable1 as name1, variable2 as name2, nameN' export statement", "Deleted the 'name1, name2, nameN' export statement", "Deleted the 'name1 = value1, name2 = value2, name3, nameN' export statement", "Deleted the 'namedFunction' export statement", - "Deleted the 'anonymous function' export statement", + "Deleted the 'anonymous() function' export statement", "Deleted the 'name1' export statement", "Deleted the 'name1 as default' export statement", "Deleted the ''foo'' export statement", "Deleted the 'name1, name2, nameN from 'foo'' export statement", "Deleted the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement", + "Deleted the ''foo'' export statement", "Added the 'name4, name5, name6, nameZ' export statement", "Added the 'variable2 as name2, variable3 as name3, nameY' export statement", "Added the 'name3, name4, nameT' export statement", "Added the 'name2 = value2, name3 = value3, name4, nameO' export statement", "Added the 'otherNamedFunction' export statement", "Added the 'newName1' export statement", - "Added the 'anonymous function' export statement", + "Added the 'anonymous() function' export statement", "Added the 'name2 as statement' export statement", "Added the ''baz'' export statement", "Added the 'name7, name8, nameP from 'buzz'' export statement", - "Added the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement" + "Added the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement", + "Added the ''fuzz'' export statement" ] }, "errors": {} @@ -195,9 +205,9 @@ "filePaths": [ "export.js" ], - "sha1": "9382cc83e945c2651b24d614a19b55bc0f0d7c98", + "sha1": "a5a2156bcfc567018bf1295f403bc508694e1f06", "gitDir": "test/corpus/repos/javascript", - "sha2": "06627b404ed1e8282d55b0be883e00b3f544a64a" + "sha2": "9e907f04c90df18302a91a6f8b4dc018b19e43e8" } ,{ "testCaseDescription": "javascript-export-delete-test", @@ -209,12 +219,13 @@ "Deleted the 'name1, name2, nameN' export statement", "Deleted the 'name1 = value1, name2 = value2, name3, nameN' export statement", "Deleted the 'namedFunction' export statement", - "Deleted the 'anonymous function' export statement", + "Deleted the 'anonymous() function' export statement", "Deleted the 'name1' export statement", "Deleted the 'name1 as default' export statement", "Deleted the ''foo'' export statement", "Deleted the 'name1, name2, nameN from 'foo'' export statement", - "Deleted the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement" + "Deleted the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement", + "Deleted the ''foo'' export statement" ] }, "errors": {} @@ -222,9 +233,9 @@ "filePaths": [ "export.js" ], - "sha1": "06627b404ed1e8282d55b0be883e00b3f544a64a", + "sha1": "9e907f04c90df18302a91a6f8b4dc018b19e43e8", "gitDir": "test/corpus/repos/javascript", - "sha2": "91ba0af4297ddc15593bdd91e34fff7473716e65" + "sha2": "da44111a6de511c202267332ed8c317555a4bca6" } ,{ "testCaseDescription": "javascript-export-delete-rest-test", @@ -237,11 +248,12 @@ "Deleted the 'name2 = value2, name3 = value3, name4, nameO' export statement", "Deleted the 'otherNamedFunction' export statement", "Deleted the 'newName1' export statement", - "Deleted the 'anonymous function' export statement", + "Deleted the 'anonymous() function' export statement", "Deleted the 'name2 as statement' export statement", "Deleted the ''baz'' export statement", "Deleted the 'name7, name8, nameP from 'buzz'' export statement", - "Deleted the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement" + "Deleted the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement", + "Deleted the ''fuzz'' export statement" ] }, "errors": {} @@ -249,7 +261,7 @@ "filePaths": [ "export.js" ], - "sha1": "91ba0af4297ddc15593bdd91e34fff7473716e65", + "sha1": "da44111a6de511c202267332ed8c317555a4bca6", "gitDir": "test/corpus/repos/javascript", - "sha2": "fb064149615bbed414b5ecaaf882340f43131080" + "sha2": "1196ba740e7d6f77d2308f6fee7f52eb79391e52" }] diff --git a/test/corpus/diff-summaries/javascript/import.json b/test/corpus/diff-summaries/javascript/import.json index 9bcdca7fb..db733fa5e 100644 --- a/test/corpus/diff-summaries/javascript/import.json +++ b/test/corpus/diff-summaries/javascript/import.json @@ -18,9 +18,9 @@ "filePaths": [ "import.js" ], - "sha1": "d685b3cf57cbdd7f8768efbd4ec03fc5d81b4241", + "sha1": "1dd83bed0770275c8762415789a3cbaa1bb8e179", "gitDir": "test/corpus/repos/javascript", - "sha2": "34c225bdf15010b290062b5ddab51cbcfc71b543" + "sha2": "5b66ff0d630bda6bd22e6a9fc705a9dd61e2ecba" } ,{ "testCaseDescription": "javascript-import-replacement-insert-test", @@ -50,9 +50,9 @@ "filePaths": [ "import.js" ], - "sha1": "34c225bdf15010b290062b5ddab51cbcfc71b543", + "sha1": "5b66ff0d630bda6bd22e6a9fc705a9dd61e2ecba", "gitDir": "test/corpus/repos/javascript", - "sha2": "41b25e26f3d0aaa9dd1ada3a2eb2cbacfbe7c039" + "sha2": "645228e699ed1c933059a3be09e9c4939f5c8ca3" } ,{ "testCaseDescription": "javascript-import-delete-insert-test", @@ -85,9 +85,9 @@ "filePaths": [ "import.js" ], - "sha1": "41b25e26f3d0aaa9dd1ada3a2eb2cbacfbe7c039", + "sha1": "645228e699ed1c933059a3be09e9c4939f5c8ca3", "gitDir": "test/corpus/repos/javascript", - "sha2": "a56cabf5afa66506c328a089ca529c04835a0571" + "sha2": "840f46c17f5d299c614232ac7b13b130ccfdcfd5" } ,{ "testCaseDescription": "javascript-import-replacement-test", @@ -120,9 +120,9 @@ "filePaths": [ "import.js" ], - "sha1": "a56cabf5afa66506c328a089ca529c04835a0571", + "sha1": "840f46c17f5d299c614232ac7b13b130ccfdcfd5", "gitDir": "test/corpus/repos/javascript", - "sha2": "c17186c7d0c948ecedf696bd0e87bf2cc14ebccf" + "sha2": "0ee9dc9cdb6a8db914f16847778171ae6640b44c" } ,{ "testCaseDescription": "javascript-import-delete-replacement-test", @@ -160,9 +160,9 @@ "filePaths": [ "import.js" ], - "sha1": "c17186c7d0c948ecedf696bd0e87bf2cc14ebccf", + "sha1": "0ee9dc9cdb6a8db914f16847778171ae6640b44c", "gitDir": "test/corpus/repos/javascript", - "sha2": "621344d7e9aae96986e974fa4dcc62687751ed15" + "sha2": "0e7fa88f6fc09fc937f3a0da33fac4d9c223ca95" } ,{ "testCaseDescription": "javascript-import-delete-test", @@ -184,9 +184,9 @@ "filePaths": [ "import.js" ], - "sha1": "621344d7e9aae96986e974fa4dcc62687751ed15", + "sha1": "0e7fa88f6fc09fc937f3a0da33fac4d9c223ca95", "gitDir": "test/corpus/repos/javascript", - "sha2": "c051b67ebe0d99d2c487b81603748f63a62a4d8b" + "sha2": "6968186cd1bb4147ca23c5982b4b4afcfd98ef25" } ,{ "testCaseDescription": "javascript-import-delete-rest-test", @@ -208,7 +208,7 @@ "filePaths": [ "import.js" ], - "sha1": "c051b67ebe0d99d2c487b81603748f63a62a4d8b", + "sha1": "6968186cd1bb4147ca23c5982b4b4afcfd98ef25", "gitDir": "test/corpus/repos/javascript", - "sha2": "c638621fba68755f220c04aae5e9fa82c12c013c" + "sha2": "0b6e5350df06e21bab5f8f51a2c41fd12627497f" }] diff --git a/test/corpus/repos/javascript b/test/corpus/repos/javascript index fb0641496..1196ba740 160000 --- a/test/corpus/repos/javascript +++ b/test/corpus/repos/javascript @@ -1 +1 @@ -Subproject commit fb064149615bbed414b5ecaaf882340f43131080 +Subproject commit 1196ba740e7d6f77d2308f6fee7f52eb79391e52 From d9660efdbebfb057121b6d58d63f5da009b63e3b Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 7 Oct 2016 16:42:47 -0500 Subject: [PATCH 15/16] Prevent double quoting for export statements --- src/DiffSummary.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/DiffSummary.hs b/src/DiffSummary.hs index 4ff534dc5..e3cf92630 100644 --- a/src/DiffSummary.hs +++ b/src/DiffSummary.hs @@ -128,6 +128,7 @@ toLeafInfos (LeafInfo "number" termName) = pure (squotes (toDoc termName)) toLeafInfos (LeafInfo "boolean" termName) = pure (squotes (toDoc termName)) toLeafInfos (LeafInfo "anonymous function" termName) = pure (toDoc termName) toLeafInfos (LeafInfo cName@"string" termName) = pure (toDoc termName <+> toDoc cName) +toLeafInfos (LeafInfo cName@"export statement" termName) = pure (toDoc termName <+> toDoc cName) toLeafInfos LeafInfo{..} = pure (squotes (toDoc termName) <+> toDoc categoryName) toLeafInfos BranchInfo{..} = toLeafInfos =<< branches toLeafInfos err@ErrorInfo{} = pure (pretty err) From d6f9104237fa6d4626f6b15d4842d5ec6055ba6d Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Fri, 7 Oct 2016 16:43:01 -0500 Subject: [PATCH 16/16] Update tests --- .../diff-summaries/javascript/export.json | 294 +++++++++--------- .../diff-summaries/javascript/import.json | 28 +- test/corpus/repos/javascript | 2 +- 3 files changed, 162 insertions(+), 162 deletions(-) diff --git a/test/corpus/diff-summaries/javascript/export.json b/test/corpus/diff-summaries/javascript/export.json index 9807cec04..8b1948f56 100644 --- a/test/corpus/diff-summaries/javascript/export.json +++ b/test/corpus/diff-summaries/javascript/export.json @@ -3,18 +3,18 @@ "expectedResult": { "changes": { "export.js": [ - "Added the 'name1, name2, name3, nameN' export statement", - "Added the 'variable1 as name1, variable2 as name2, nameN' export statement", - "Added the 'name1, name2, nameN' export statement", - "Added the 'name1 = value1, name2 = value2, name3, nameN' export statement", - "Added the 'namedFunction' export statement", - "Added the 'anonymous() function' export statement", - "Added the 'name1' export statement", - "Added the 'name1 as default' export statement", - "Added the ''foo'' export statement", - "Added the 'name1, name2, nameN from 'foo'' export statement", - "Added the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement", - "Added the ''foo'' export statement" + "Added the name1, name2, name3, nameN export statement", + "Added the variable1 as name1, variable2 as name2, nameN export statement", + "Added the name1, name2, nameN export statement", + "Added the name1 = value1, name2 = value2, name3, nameN export statement", + "Added the namedFunction export statement", + "Added the anonymous() function export statement", + "Added the name1 export statement", + "Added the name1 as default export statement", + "Added the 'foo' export statement", + "Added the name1, name2, nameN from 'foo' export statement", + "Added the import1 as name1, import2 as name2, nameN from 'bar' export statement", + "Added the 'foo' export statement" ] }, "errors": {} @@ -22,39 +22,39 @@ "filePaths": [ "export.js" ], - "sha1": "0b6e5350df06e21bab5f8f51a2c41fd12627497f", + "sha1": "fbc5b11fcf02fc81e576ea8ec5d4e590a6a4cf6c", "gitDir": "test/corpus/repos/javascript", - "sha2": "8237fd20919d59edf776e9ba46aa5615d4d9c923" + "sha2": "2a02b3c789985c3d109009301b6b75f7151dfa26" } ,{ "testCaseDescription": "javascript-export-replacement-insert-test", "expectedResult": { "changes": { "export.js": [ - "Added the 'name4, name5, name6, nameZ' export statement", - "Added the 'variable2 as name2, variable3 as name3, nameY' export statement", - "Added the 'name3, name4, nameT' export statement", - "Added the 'name2 = value2, name3 = value3, name4, nameO' export statement", - "Added the 'otherNamedFunction' export statement", - "Added the 'newName1' export statement", - "Added the 'anonymous() function' export statement", - "Added the 'name2 as statement' export statement", - "Added the ''baz'' export statement", - "Added the 'name7, name8, nameP from 'buzz'' export statement", - "Added the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement", - "Added the ''fuzz'' export statement", - "Added the 'name1, name2, name3, nameN' export statement", - "Added the 'variable1 as name1, variable2 as name2, nameN' export statement", - "Added the 'name1, name2, nameN' export statement", - "Added the 'name1 = value1, name2 = value2, name3, nameN' export statement", - "Added the 'namedFunction' export statement", - "Added the 'anonymous() function' export statement", - "Added the 'name1' export statement", - "Added the 'name1 as default' export statement", - "Added the ''foo'' export statement", - "Added the 'name1, name2, nameN from 'foo'' export statement", - "Added the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement", - "Added the ''foo'' export statement" + "Added the name4, name5, name6, nameZ export statement", + "Added the variable2 as name2, variable3 as name3, nameY export statement", + "Added the name3, name4, nameT export statement", + "Added the name2 = value2, name3 = value3, name4, nameO export statement", + "Added the otherNamedFunction export statement", + "Added the newName1 export statement", + "Added the anonymous() function export statement", + "Added the name2 as statement export statement", + "Added the 'baz' export statement", + "Added the name7, name8, nameP from 'buzz' export statement", + "Added the import6 as name6, import7 as name7, nameB from 'fizz' export statement", + "Added the 'fuzz' export statement", + "Added the name1, name2, name3, nameN export statement", + "Added the variable1 as name1, variable2 as name2, nameN export statement", + "Added the name1, name2, nameN export statement", + "Added the name1 = value1, name2 = value2, name3, nameN export statement", + "Added the namedFunction export statement", + "Added the anonymous() function export statement", + "Added the name1 export statement", + "Added the name1 as default export statement", + "Added the 'foo' export statement", + "Added the name1, name2, nameN from 'foo' export statement", + "Added the import1 as name1, import2 as name2, nameN from 'bar' export statement", + "Added the 'foo' export statement" ] }, "errors": {} @@ -62,9 +62,9 @@ "filePaths": [ "export.js" ], - "sha1": "8237fd20919d59edf776e9ba46aa5615d4d9c923", + "sha1": "2a02b3c789985c3d109009301b6b75f7151dfa26", "gitDir": "test/corpus/repos/javascript", - "sha2": "96b3e68587f823137392118b1bb6f2442af92d0e" + "sha2": "a86486153befecb5a8435248342ae9ee5f9bb9fe" } ,{ "testCaseDescription": "javascript-export-delete-insert-test", @@ -89,21 +89,21 @@ "Replaced the 'value3' identifier with the 'value2' identifier in the name2 var assignment", "Replaced the 'name4' identifier with the 'name3' identifier in the name1 = value1, name2 = value2, name3, nameN export statement", "Replaced the 'nameO' identifier with the 'nameN' identifier in the name1 = value1, name2 = value2, name3, nameN export statement", - "Added the 'namedFunction' export statement", - "Added the 'anonymous() function' export statement", - "Added the 'name1' export statement", - "Added the 'name1 as default' export statement", - "Replaced the 'otherNamedFunction' export statement with the ''foo'' export statement", - "Added the 'name1, name2, nameN from 'foo'' export statement", - "Added the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement", - "Added the ''foo'' export statement", - "Deleted the 'newName1' export statement", - "Deleted the 'anonymous() function' export statement", - "Deleted the 'name2 as statement' export statement", - "Deleted the ''baz'' export statement", - "Deleted the 'name7, name8, nameP from 'buzz'' export statement", - "Deleted the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement", - "Deleted the ''fuzz'' export statement" + "Added the namedFunction export statement", + "Added the anonymous() function export statement", + "Added the name1 export statement", + "Added the name1 as default export statement", + "Replaced the otherNamedFunction export statement with the 'foo' export statement", + "Added the name1, name2, nameN from 'foo' export statement", + "Added the import1 as name1, import2 as name2, nameN from 'bar' export statement", + "Added the 'foo' export statement", + "Deleted the newName1 export statement", + "Deleted the anonymous() function export statement", + "Deleted the name2 as statement export statement", + "Deleted the 'baz' export statement", + "Deleted the name7, name8, nameP from 'buzz' export statement", + "Deleted the import6 as name6, import7 as name7, nameB from 'fizz' export statement", + "Deleted the 'fuzz' export statement" ] }, "errors": {} @@ -111,9 +111,9 @@ "filePaths": [ "export.js" ], - "sha1": "96b3e68587f823137392118b1bb6f2442af92d0e", + "sha1": "a86486153befecb5a8435248342ae9ee5f9bb9fe", "gitDir": "test/corpus/repos/javascript", - "sha2": "9ba7428803482b02837ac9dc033c1fe18e655975" + "sha2": "7b46f842245529860476386742508d3086628b4b" } ,{ "testCaseDescription": "javascript-export-replacement-test", @@ -124,28 +124,28 @@ "Replaced the 'name2' identifier with the 'name5' identifier in the name4, name5, name6, nameZ export statement", "Replaced the 'name3' identifier with the 'name6' identifier in the name4, name5, name6, nameZ export statement", "Replaced the 'nameN' identifier with the 'nameZ' identifier in the name4, name5, name6, nameZ export statement", - "Added the 'variable2 as name2, variable3 as name3, nameY' export statement", - "Added the 'name3, name4, nameT' export statement", - "Added the 'name2 = value2, name3 = value3, name4, nameO' export statement", - "Added the 'otherNamedFunction' export statement", - "Added the 'newName1' export statement", - "Added the 'anonymous() function' export statement", - "Added the 'name2 as statement' export statement", - "Added the ''baz'' export statement", - "Added the 'name7, name8, nameP from 'buzz'' export statement", - "Added the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement", - "Added the ''fuzz'' export statement", - "Deleted the 'variable1 as name1, variable2 as name2, nameN' export statement", - "Deleted the 'name1, name2, nameN' export statement", - "Deleted the 'name1 = value1, name2 = value2, name3, nameN' export statement", - "Deleted the 'namedFunction' export statement", - "Deleted the 'anonymous() function' export statement", - "Deleted the 'name1' export statement", - "Deleted the 'name1 as default' export statement", - "Deleted the ''foo'' export statement", - "Deleted the 'name1, name2, nameN from 'foo'' export statement", - "Deleted the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement", - "Deleted the ''foo'' export statement" + "Added the variable2 as name2, variable3 as name3, nameY export statement", + "Added the name3, name4, nameT export statement", + "Added the name2 = value2, name3 = value3, name4, nameO export statement", + "Added the otherNamedFunction export statement", + "Added the newName1 export statement", + "Added the anonymous() function export statement", + "Added the name2 as statement export statement", + "Added the 'baz' export statement", + "Added the name7, name8, nameP from 'buzz' export statement", + "Added the import6 as name6, import7 as name7, nameB from 'fizz' export statement", + "Added the 'fuzz' export statement", + "Deleted the variable1 as name1, variable2 as name2, nameN export statement", + "Deleted the name1, name2, nameN export statement", + "Deleted the name1 = value1, name2 = value2, name3, nameN export statement", + "Deleted the namedFunction export statement", + "Deleted the anonymous() function export statement", + "Deleted the name1 export statement", + "Deleted the name1 as default export statement", + "Deleted the 'foo' export statement", + "Deleted the name1, name2, nameN from 'foo' export statement", + "Deleted the import1 as name1, import2 as name2, nameN from 'bar' export statement", + "Deleted the 'foo' export statement" ] }, "errors": {} @@ -153,51 +153,51 @@ "filePaths": [ "export.js" ], - "sha1": "9ba7428803482b02837ac9dc033c1fe18e655975", + "sha1": "7b46f842245529860476386742508d3086628b4b", "gitDir": "test/corpus/repos/javascript", - "sha2": "a5a2156bcfc567018bf1295f403bc508694e1f06" + "sha2": "1586e1f5d610cc2c194478f3aeec506172299c7b" } ,{ "testCaseDescription": "javascript-export-delete-replacement-test", "expectedResult": { "changes": { "export.js": [ - "Deleted the 'name4, name5, name6, nameZ' export statement", - "Deleted the 'variable2 as name2, variable3 as name3, nameY' export statement", - "Deleted the 'name3, name4, nameT' export statement", - "Deleted the 'name2 = value2, name3 = value3, name4, nameO' export statement", - "Deleted the 'otherNamedFunction' export statement", - "Deleted the 'newName1' export statement", - "Deleted the 'anonymous() function' export statement", - "Deleted the 'name2 as statement' export statement", - "Deleted the ''baz'' export statement", - "Deleted the 'name7, name8, nameP from 'buzz'' export statement", - "Deleted the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement", - "Deleted the ''fuzz'' export statement", - "Deleted the 'name1, name2, name3, nameN' export statement", - "Deleted the 'variable1 as name1, variable2 as name2, nameN' export statement", - "Deleted the 'name1, name2, nameN' export statement", - "Deleted the 'name1 = value1, name2 = value2, name3, nameN' export statement", - "Deleted the 'namedFunction' export statement", - "Deleted the 'anonymous() function' export statement", - "Deleted the 'name1' export statement", - "Deleted the 'name1 as default' export statement", - "Deleted the ''foo'' export statement", - "Deleted the 'name1, name2, nameN from 'foo'' export statement", - "Deleted the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement", - "Deleted the ''foo'' export statement", - "Added the 'name4, name5, name6, nameZ' export statement", - "Added the 'variable2 as name2, variable3 as name3, nameY' export statement", - "Added the 'name3, name4, nameT' export statement", - "Added the 'name2 = value2, name3 = value3, name4, nameO' export statement", - "Added the 'otherNamedFunction' export statement", - "Added the 'newName1' export statement", - "Added the 'anonymous() function' export statement", - "Added the 'name2 as statement' export statement", - "Added the ''baz'' export statement", - "Added the 'name7, name8, nameP from 'buzz'' export statement", - "Added the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement", - "Added the ''fuzz'' export statement" + "Deleted the name4, name5, name6, nameZ export statement", + "Deleted the variable2 as name2, variable3 as name3, nameY export statement", + "Deleted the name3, name4, nameT export statement", + "Deleted the name2 = value2, name3 = value3, name4, nameO export statement", + "Deleted the otherNamedFunction export statement", + "Deleted the newName1 export statement", + "Deleted the anonymous() function export statement", + "Deleted the name2 as statement export statement", + "Deleted the 'baz' export statement", + "Deleted the name7, name8, nameP from 'buzz' export statement", + "Deleted the import6 as name6, import7 as name7, nameB from 'fizz' export statement", + "Deleted the 'fuzz' export statement", + "Deleted the name1, name2, name3, nameN export statement", + "Deleted the variable1 as name1, variable2 as name2, nameN export statement", + "Deleted the name1, name2, nameN export statement", + "Deleted the name1 = value1, name2 = value2, name3, nameN export statement", + "Deleted the namedFunction export statement", + "Deleted the anonymous() function export statement", + "Deleted the name1 export statement", + "Deleted the name1 as default export statement", + "Deleted the 'foo' export statement", + "Deleted the name1, name2, nameN from 'foo' export statement", + "Deleted the import1 as name1, import2 as name2, nameN from 'bar' export statement", + "Deleted the 'foo' export statement", + "Added the name4, name5, name6, nameZ export statement", + "Added the variable2 as name2, variable3 as name3, nameY export statement", + "Added the name3, name4, nameT export statement", + "Added the name2 = value2, name3 = value3, name4, nameO export statement", + "Added the otherNamedFunction export statement", + "Added the newName1 export statement", + "Added the anonymous() function export statement", + "Added the name2 as statement export statement", + "Added the 'baz' export statement", + "Added the name7, name8, nameP from 'buzz' export statement", + "Added the import6 as name6, import7 as name7, nameB from 'fizz' export statement", + "Added the 'fuzz' export statement" ] }, "errors": {} @@ -205,27 +205,27 @@ "filePaths": [ "export.js" ], - "sha1": "a5a2156bcfc567018bf1295f403bc508694e1f06", + "sha1": "1586e1f5d610cc2c194478f3aeec506172299c7b", "gitDir": "test/corpus/repos/javascript", - "sha2": "9e907f04c90df18302a91a6f8b4dc018b19e43e8" + "sha2": "8ed6038b2ae6a12b88e6139701f2fc038ee2fe60" } ,{ "testCaseDescription": "javascript-export-delete-test", "expectedResult": { "changes": { "export.js": [ - "Deleted the 'name1, name2, name3, nameN' export statement", - "Deleted the 'variable1 as name1, variable2 as name2, nameN' export statement", - "Deleted the 'name1, name2, nameN' export statement", - "Deleted the 'name1 = value1, name2 = value2, name3, nameN' export statement", - "Deleted the 'namedFunction' export statement", - "Deleted the 'anonymous() function' export statement", - "Deleted the 'name1' export statement", - "Deleted the 'name1 as default' export statement", - "Deleted the ''foo'' export statement", - "Deleted the 'name1, name2, nameN from 'foo'' export statement", - "Deleted the 'import1 as name1, import2 as name2, nameN from 'bar'' export statement", - "Deleted the ''foo'' export statement" + "Deleted the name1, name2, name3, nameN export statement", + "Deleted the variable1 as name1, variable2 as name2, nameN export statement", + "Deleted the name1, name2, nameN export statement", + "Deleted the name1 = value1, name2 = value2, name3, nameN export statement", + "Deleted the namedFunction export statement", + "Deleted the anonymous() function export statement", + "Deleted the name1 export statement", + "Deleted the name1 as default export statement", + "Deleted the 'foo' export statement", + "Deleted the name1, name2, nameN from 'foo' export statement", + "Deleted the import1 as name1, import2 as name2, nameN from 'bar' export statement", + "Deleted the 'foo' export statement" ] }, "errors": {} @@ -233,27 +233,27 @@ "filePaths": [ "export.js" ], - "sha1": "9e907f04c90df18302a91a6f8b4dc018b19e43e8", + "sha1": "8ed6038b2ae6a12b88e6139701f2fc038ee2fe60", "gitDir": "test/corpus/repos/javascript", - "sha2": "da44111a6de511c202267332ed8c317555a4bca6" + "sha2": "5fa5440ad72fb78f66fdb8163b2cb7e669a0c9f7" } ,{ "testCaseDescription": "javascript-export-delete-rest-test", "expectedResult": { "changes": { "export.js": [ - "Deleted the 'name4, name5, name6, nameZ' export statement", - "Deleted the 'variable2 as name2, variable3 as name3, nameY' export statement", - "Deleted the 'name3, name4, nameT' export statement", - "Deleted the 'name2 = value2, name3 = value3, name4, nameO' export statement", - "Deleted the 'otherNamedFunction' export statement", - "Deleted the 'newName1' export statement", - "Deleted the 'anonymous() function' export statement", - "Deleted the 'name2 as statement' export statement", - "Deleted the ''baz'' export statement", - "Deleted the 'name7, name8, nameP from 'buzz'' export statement", - "Deleted the 'import6 as name6, import7 as name7, nameB from 'fizz'' export statement", - "Deleted the ''fuzz'' export statement" + "Deleted the name4, name5, name6, nameZ export statement", + "Deleted the variable2 as name2, variable3 as name3, nameY export statement", + "Deleted the name3, name4, nameT export statement", + "Deleted the name2 = value2, name3 = value3, name4, nameO export statement", + "Deleted the otherNamedFunction export statement", + "Deleted the newName1 export statement", + "Deleted the anonymous() function export statement", + "Deleted the name2 as statement export statement", + "Deleted the 'baz' export statement", + "Deleted the name7, name8, nameP from 'buzz' export statement", + "Deleted the import6 as name6, import7 as name7, nameB from 'fizz' export statement", + "Deleted the 'fuzz' export statement" ] }, "errors": {} @@ -261,7 +261,7 @@ "filePaths": [ "export.js" ], - "sha1": "da44111a6de511c202267332ed8c317555a4bca6", + "sha1": "5fa5440ad72fb78f66fdb8163b2cb7e669a0c9f7", "gitDir": "test/corpus/repos/javascript", - "sha2": "1196ba740e7d6f77d2308f6fee7f52eb79391e52" + "sha2": "870c7e629a76e123abf0a4f8095499e596838bfd" }] diff --git a/test/corpus/diff-summaries/javascript/import.json b/test/corpus/diff-summaries/javascript/import.json index db733fa5e..7b0137fa5 100644 --- a/test/corpus/diff-summaries/javascript/import.json +++ b/test/corpus/diff-summaries/javascript/import.json @@ -18,9 +18,9 @@ "filePaths": [ "import.js" ], - "sha1": "1dd83bed0770275c8762415789a3cbaa1bb8e179", + "sha1": "fdbc1266a42600d265109d102da2496e26a9d3f2", "gitDir": "test/corpus/repos/javascript", - "sha2": "5b66ff0d630bda6bd22e6a9fc705a9dd61e2ecba" + "sha2": "df90633016b5463425deb3d74463cdcc32b76889" } ,{ "testCaseDescription": "javascript-import-replacement-insert-test", @@ -50,9 +50,9 @@ "filePaths": [ "import.js" ], - "sha1": "5b66ff0d630bda6bd22e6a9fc705a9dd61e2ecba", + "sha1": "df90633016b5463425deb3d74463cdcc32b76889", "gitDir": "test/corpus/repos/javascript", - "sha2": "645228e699ed1c933059a3be09e9c4939f5c8ca3" + "sha2": "95c90ad1bea428330d0b62f02e607b4509de89d2" } ,{ "testCaseDescription": "javascript-import-delete-insert-test", @@ -85,9 +85,9 @@ "filePaths": [ "import.js" ], - "sha1": "645228e699ed1c933059a3be09e9c4939f5c8ca3", + "sha1": "95c90ad1bea428330d0b62f02e607b4509de89d2", "gitDir": "test/corpus/repos/javascript", - "sha2": "840f46c17f5d299c614232ac7b13b130ccfdcfd5" + "sha2": "e7a974df1ae0a2993d5eeda4edd1b586adffe84f" } ,{ "testCaseDescription": "javascript-import-replacement-test", @@ -120,9 +120,9 @@ "filePaths": [ "import.js" ], - "sha1": "840f46c17f5d299c614232ac7b13b130ccfdcfd5", + "sha1": "e7a974df1ae0a2993d5eeda4edd1b586adffe84f", "gitDir": "test/corpus/repos/javascript", - "sha2": "0ee9dc9cdb6a8db914f16847778171ae6640b44c" + "sha2": "ab39b6f04b648cbddfd6afa3470995a0cd6fee69" } ,{ "testCaseDescription": "javascript-import-delete-replacement-test", @@ -160,9 +160,9 @@ "filePaths": [ "import.js" ], - "sha1": "0ee9dc9cdb6a8db914f16847778171ae6640b44c", + "sha1": "ab39b6f04b648cbddfd6afa3470995a0cd6fee69", "gitDir": "test/corpus/repos/javascript", - "sha2": "0e7fa88f6fc09fc937f3a0da33fac4d9c223ca95" + "sha2": "e9b593a62e90802adf1e1c7a91e8299116092602" } ,{ "testCaseDescription": "javascript-import-delete-test", @@ -184,9 +184,9 @@ "filePaths": [ "import.js" ], - "sha1": "0e7fa88f6fc09fc937f3a0da33fac4d9c223ca95", + "sha1": "e9b593a62e90802adf1e1c7a91e8299116092602", "gitDir": "test/corpus/repos/javascript", - "sha2": "6968186cd1bb4147ca23c5982b4b4afcfd98ef25" + "sha2": "aca47c2554e1cf1ab3f0864b01040937488a39e5" } ,{ "testCaseDescription": "javascript-import-delete-rest-test", @@ -208,7 +208,7 @@ "filePaths": [ "import.js" ], - "sha1": "6968186cd1bb4147ca23c5982b4b4afcfd98ef25", + "sha1": "aca47c2554e1cf1ab3f0864b01040937488a39e5", "gitDir": "test/corpus/repos/javascript", - "sha2": "0b6e5350df06e21bab5f8f51a2c41fd12627497f" + "sha2": "fbc5b11fcf02fc81e576ea8ec5d4e590a6a4cf6c" }] diff --git a/test/corpus/repos/javascript b/test/corpus/repos/javascript index 1196ba740..870c7e629 160000 --- a/test/corpus/repos/javascript +++ b/test/corpus/repos/javascript @@ -1 +1 @@ -Subproject commit 1196ba740e7d6f77d2308f6fee7f52eb79391e52 +Subproject commit 870c7e629a76e123abf0a4f8095499e596838bfd