{"action":"created","comment":{"url":"https://api.github.com/repos/CommBank/maestro/pulls/comments/28849655","id":28849655,"diff_hunk":"@@ -0,0 +1,216 @@\n+//   Copyright 2014 Commonwealth Bank of Australia\n+//\n+//   Licensed under the Apache License, Version 2.0 (the \"License\");\n+//   you may not use this file except in compliance with the License.\n+//   You may obtain a copy of the License at\n+//\n+//     http://www.apache.org/licenses/LICENSE-2.0\n+//\n+//   Unless required by applicable law or agreed to in writing, software\n+//   distributed under the License is distributed on an \"AS IS\" BASIS,\n+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+//   See the License for the specific language governing permissions and\n+//   limitations under the License.\n+\n+package au.com.cba.omnia.maestro.macros\n+\n+import scala.annotation.StaticAnnotation\n+\n+import scala.reflect.macros.{Context, TypecheckException}\n+\n+import scala.language.experimental.macros\n+\n+import scala.collection.immutable.StringOps\n+\n+/** Automapper for Thrift structs.\n+  *\n+  * One or more input structs are mapped to a single output struct, using a custom syntax to\n+  * define mapping rules for each field. Output struct fields for which mapping rules are\n+  * unspecified are mapped to matching fields with the same name and type in the input structs.\n+  * If more than one such input candidate exists, all structs with a field by this name must\n+  * agree on its value, otherwise a runtime exception is raised.\n+  *\n+  * To use the automapper, declare a method with the desired signature, assign to it a tuple of\n+  * transformation rules and annotate it with @automapper. The macro fills in the method with\n+  * the required logic. A simple use of the automapper annotation macro might look like this:\n+  * \n+  *   @automapper def mkFooBar (foo: Foo, bar: Bar): FooBar = (\n+  *       thisInt    := foo.thatInt,\n+  *       thisString := bar.thatString\n+  *   )\n+  *\n+  * The macro comprises three overlapping stages: *reflection* on the inputs and outputs,\n+  * *computation* of field mappings and *generation* of output code.\n+  */\n+object Automap {\n+  def impl(c: Context)(annottees: c.Expr[Any]*): c.Expr[Any] = {\n+    import c.universe._","path":"maestro-macros/src/main/scala/au/com/cba/omnia/maestro/macros/Automap.scala","position":47,"original_position":47,"commit_id":"a3aa81b5bb07f3f73b1b87ee6a5de3beea3584ef","original_commit_id":"a3aa81b5bb07f3f73b1b87ee6a5de3beea3584ef","user":{"login":"stephanh","id":376868,"avatar_url":"https://avatars.githubusercontent.com/u/376868?v=3","gravatar_id":"","url":"https://api.github.com/users/stephanh","html_url":"https://github.com/stephanh","followers_url":"https://api.github.com/users/stephanh/followers","following_url":"https://api.github.com/users/stephanh/following{/other_user}","gists_url":"https://api.github.com/users/stephanh/gists{/gist_id}","starred_url":"https://api.github.com/users/stephanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephanh/subscriptions","organizations_url":"https://api.github.com/users/stephanh/orgs","repos_url":"https://api.github.com/users/stephanh/repos","events_url":"https://api.github.com/users/stephanh/events{/privacy}","received_events_url":"https://api.github.com/users/stephanh/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/versioned/images/favicon.png) Issue found: [Imports should be grouped together](https://www.codacy.com/app/CommBank/maestro/file/561747657/issues/source?bid=2205397&fileBranchId=2256027#l47)","created_at":"2015-04-22T07:22:46Z","updated_at":"2015-04-22T07:22:46Z","html_url":"https://github.com/CommBank/maestro/pull/369#discussion_r28849655","pull_request_url":"https://api.github.com/repos/CommBank/maestro/pulls/369","_links":{"self":{"href":"https://api.github.com/repos/CommBank/maestro/pulls/comments/28849655"},"html":{"href":"https://github.com/CommBank/maestro/pull/369#discussion_r28849655"},"pull_request":{"href":"https://api.github.com/repos/CommBank/maestro/pulls/369"}}},"pull_request":{"url":"https://api.github.com/repos/CommBank/maestro/pulls/369","id":33516476,"html_url":"https://github.com/CommBank/maestro/pull/369","diff_url":"https://github.com/CommBank/maestro/pull/369.diff","patch_url":"https://github.com/CommBank/maestro/pull/369.patch","issue_url":"https://api.github.com/repos/CommBank/maestro/issues/369","number":369,"state":"open","locked":false,"title":"Transformer macro annotation","user":{"login":"shmookey","id":2177430,"avatar_url":"https://avatars.githubusercontent.com/u/2177430?v=3","gravatar_id":"","url":"https://api.github.com/users/shmookey","html_url":"https://github.com/shmookey","followers_url":"https://api.github.com/users/shmookey/followers","following_url":"https://api.github.com/users/shmookey/following{/other_user}","gists_url":"https://api.github.com/users/shmookey/gists{/gist_id}","starred_url":"https://api.github.com/users/shmookey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shmookey/subscriptions","organizations_url":"https://api.github.com/users/shmookey/orgs","repos_url":"https://api.github.com/users/shmookey/repos","events_url":"https://api.github.com/users/shmookey/events{/privacy}","received_events_url":"https://api.github.com/users/shmookey/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-17T05:59:03Z","updated_at":"2015-04-22T07:22:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c808fc67145cdf24b9a1093d300376cc946a4a76","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CommBank/maestro/pulls/369/commits","review_comments_url":"https://api.github.com/repos/CommBank/maestro/pulls/369/comments","review_comment_url":"https://api.github.com/repos/CommBank/maestro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CommBank/maestro/issues/369/comments","statuses_url":"https://api.github.com/repos/CommBank/maestro/statuses/a3aa81b5bb07f3f73b1b87ee6a5de3beea3584ef","head":{"label":"CommBank:feature-transformer","ref":"feature-transformer","sha":"a3aa81b5bb07f3f73b1b87ee6a5de3beea3584ef","user":{"login":"CommBank","id":4240076,"avatar_url":"https://avatars.githubusercontent.com/u/4240076?v=3","gravatar_id":"","url":"https://api.github.com/users/CommBank","html_url":"https://github.com/CommBank","followers_url":"https://api.github.com/users/CommBank/followers","following_url":"https://api.github.com/users/CommBank/following{/other_user}","gists_url":"https://api.github.com/users/CommBank/gists{/gist_id}","starred_url":"https://api.github.com/users/CommBank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CommBank/subscriptions","organizations_url":"https://api.github.com/users/CommBank/orgs","repos_url":"https://api.github.com/users/CommBank/repos","events_url":"https://api.github.com/users/CommBank/events{/privacy}","received_events_url":"https://api.github.com/users/CommBank/received_events","type":"Organization","site_admin":false},"repo":{"id":17347463,"name":"maestro","full_name":"CommBank/maestro","owner":{"login":"CommBank","id":4240076,"avatar_url":"https://avatars.githubusercontent.com/u/4240076?v=3","gravatar_id":"","url":"https://api.github.com/users/CommBank","html_url":"https://github.com/CommBank","followers_url":"https://api.github.com/users/CommBank/followers","following_url":"https://api.github.com/users/CommBank/following{/other_user}","gists_url":"https://api.github.com/users/CommBank/gists{/gist_id}","starred_url":"https://api.github.com/users/CommBank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CommBank/subscriptions","organizations_url":"https://api.github.com/users/CommBank/orgs","repos_url":"https://api.github.com/users/CommBank/repos","events_url":"https://api.github.com/users/CommBank/events{/privacy}","received_events_url":"https://api.github.com/users/CommBank/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CommBank/maestro","description":"Data Pipelines that are well typed and enforce good convention","fork":false,"url":"https://api.github.com/repos/CommBank/maestro","forks_url":"https://api.github.com/repos/CommBank/maestro/forks","keys_url":"https://api.github.com/repos/CommBank/maestro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CommBank/maestro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CommBank/maestro/teams","hooks_url":"https://api.github.com/repos/CommBank/maestro/hooks","issue_events_url":"https://api.github.com/repos/CommBank/maestro/issues/events{/number}","events_url":"https://api.github.com/repos/CommBank/maestro/events","assignees_url":"https://api.github.com/repos/CommBank/maestro/assignees{/user}","branches_url":"https://api.github.com/repos/CommBank/maestro/branches{/branch}","tags_url":"https://api.github.com/repos/CommBank/maestro/tags","blobs_url":"https://api.github.com/repos/CommBank/maestro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CommBank/maestro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CommBank/maestro/git/refs{/sha}","trees_url":"https://api.github.com/repos/CommBank/maestro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CommBank/maestro/statuses/{sha}","languages_url":"https://api.github.com/repos/CommBank/maestro/languages","stargazers_url":"https://api.github.com/repos/CommBank/maestro/stargazers","contributors_url":"https://api.github.com/repos/CommBank/maestro/contributors","subscribers_url":"https://api.github.com/repos/CommBank/maestro/subscribers","subscription_url":"https://api.github.com/repos/CommBank/maestro/subscription","commits_url":"https://api.github.com/repos/CommBank/maestro/commits{/sha}","git_commits_url":"https://api.github.com/repos/CommBank/maestro/git/commits{/sha}","comments_url":"https://api.github.com/repos/CommBank/maestro/comments{/number}","issue_comment_url":"https://api.github.com/repos/CommBank/maestro/issues/comments{/number}","contents_url":"https://api.github.com/repos/CommBank/maestro/contents/{+path}","compare_url":"https://api.github.com/repos/CommBank/maestro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CommBank/maestro/merges","archive_url":"https://api.github.com/repos/CommBank/maestro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CommBank/maestro/downloads","issues_url":"https://api.github.com/repos/CommBank/maestro/issues{/number}","pulls_url":"https://api.github.com/repos/CommBank/maestro/pulls{/number}","milestones_url":"https://api.github.com/repos/CommBank/maestro/milestones{/number}","notifications_url":"https://api.github.com/repos/CommBank/maestro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CommBank/maestro/labels{/name}","releases_url":"https://api.github.com/repos/CommBank/maestro/releases{/id}","created_at":"2014-03-02T21:34:53Z","updated_at":"2015-04-22T01:42:45Z","pushed_at":"2015-04-22T07:14:07Z","git_url":"git://github.com/CommBank/maestro.git","ssh_url":"git@github.com:CommBank/maestro.git","clone_url":"https://github.com/CommBank/maestro.git","svn_url":"https://github.com/CommBank/maestro","homepage":"https://commbank.github.io/maestro","size":45026,"stargazers_count":27,"watchers_count":27,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":16,"mirror_url":null,"open_issues_count":51,"forks":16,"open_issues":51,"watchers":27,"default_branch":"master"}},"base":{"label":"CommBank:master","ref":"master","sha":"0fdf42738f90c89897cc8cf621ae7f8e5e36a228","user":{"login":"CommBank","id":4240076,"avatar_url":"https://avatars.githubusercontent.com/u/4240076?v=3","gravatar_id":"","url":"https://api.github.com/users/CommBank","html_url":"https://github.com/CommBank","followers_url":"https://api.github.com/users/CommBank/followers","following_url":"https://api.github.com/users/CommBank/following{/other_user}","gists_url":"https://api.github.com/users/CommBank/gists{/gist_id}","starred_url":"https://api.github.com/users/CommBank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CommBank/subscriptions","organizations_url":"https://api.github.com/users/CommBank/orgs","repos_url":"https://api.github.com/users/CommBank/repos","events_url":"https://api.github.com/users/CommBank/events{/privacy}","received_events_url":"https://api.github.com/users/CommBank/received_events","type":"Organization","site_admin":false},"repo":{"id":17347463,"name":"maestro","full_name":"CommBank/maestro","owner":{"login":"CommBank","id":4240076,"avatar_url":"https://avatars.githubusercontent.com/u/4240076?v=3","gravatar_id":"","url":"https://api.github.com/users/CommBank","html_url":"https://github.com/CommBank","followers_url":"https://api.github.com/users/CommBank/followers","following_url":"https://api.github.com/users/CommBank/following{/other_user}","gists_url":"https://api.github.com/users/CommBank/gists{/gist_id}","starred_url":"https://api.github.com/users/CommBank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CommBank/subscriptions","organizations_url":"https://api.github.com/users/CommBank/orgs","repos_url":"https://api.github.com/users/CommBank/repos","events_url":"https://api.github.com/users/CommBank/events{/privacy}","received_events_url":"https://api.github.com/users/CommBank/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CommBank/maestro","description":"Data Pipelines that are well typed and enforce good convention","fork":false,"url":"https://api.github.com/repos/CommBank/maestro","forks_url":"https://api.github.com/repos/CommBank/maestro/forks","keys_url":"https://api.github.com/repos/CommBank/maestro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CommBank/maestro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CommBank/maestro/teams","hooks_url":"https://api.github.com/repos/CommBank/maestro/hooks","issue_events_url":"https://api.github.com/repos/CommBank/maestro/issues/events{/number}","events_url":"https://api.github.com/repos/CommBank/maestro/events","assignees_url":"https://api.github.com/repos/CommBank/maestro/assignees{/user}","branches_url":"https://api.github.com/repos/CommBank/maestro/branches{/branch}","tags_url":"https://api.github.com/repos/CommBank/maestro/tags","blobs_url":"https://api.github.com/repos/CommBank/maestro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CommBank/maestro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CommBank/maestro/git/refs{/sha}","trees_url":"https://api.github.com/repos/CommBank/maestro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CommBank/maestro/statuses/{sha}","languages_url":"https://api.github.com/repos/CommBank/maestro/languages","stargazers_url":"https://api.github.com/repos/CommBank/maestro/stargazers","contributors_url":"https://api.github.com/repos/CommBank/maestro/contributors","subscribers_url":"https://api.github.com/repos/CommBank/maestro/subscribers","subscription_url":"https://api.github.com/repos/CommBank/maestro/subscription","commits_url":"https://api.github.com/repos/CommBank/maestro/commits{/sha}","git_commits_url":"https://api.github.com/repos/CommBank/maestro/git/commits{/sha}","comments_url":"https://api.github.com/repos/CommBank/maestro/comments{/number}","issue_comment_url":"https://api.github.com/repos/CommBank/maestro/issues/comments{/number}","contents_url":"https://api.github.com/repos/CommBank/maestro/contents/{+path}","compare_url":"https://api.github.com/repos/CommBank/maestro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CommBank/maestro/merges","archive_url":"https://api.github.com/repos/CommBank/maestro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CommBank/maestro/downloads","issues_url":"https://api.github.com/repos/CommBank/maestro/issues{/number}","pulls_url":"https://api.github.com/repos/CommBank/maestro/pulls{/number}","milestones_url":"https://api.github.com/repos/CommBank/maestro/milestones{/number}","notifications_url":"https://api.github.com/repos/CommBank/maestro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CommBank/maestro/labels{/name}","releases_url":"https://api.github.com/repos/CommBank/maestro/releases{/id}","created_at":"2014-03-02T21:34:53Z","updated_at":"2015-04-22T01:42:45Z","pushed_at":"2015-04-22T07:14:07Z","git_url":"git://github.com/CommBank/maestro.git","ssh_url":"git@github.com:CommBank/maestro.git","clone_url":"https://github.com/CommBank/maestro.git","svn_url":"https://github.com/CommBank/maestro","homepage":"https://commbank.github.io/maestro","size":45026,"stargazers_count":27,"watchers_count":27,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":16,"mirror_url":null,"open_issues_count":51,"forks":16,"open_issues":51,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CommBank/maestro/pulls/369"},"html":{"href":"https://github.com/CommBank/maestro/pull/369"},"issue":{"href":"https://api.github.com/repos/CommBank/maestro/issues/369"},"comments":{"href":"https://api.github.com/repos/CommBank/maestro/issues/369/comments"},"review_comments":{"href":"https://api.github.com/repos/CommBank/maestro/pulls/369/comments"},"review_comment":{"href":"https://api.github.com/repos/CommBank/maestro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CommBank/maestro/pulls/369/commits"},"statuses":{"href":"https://api.github.com/repos/CommBank/maestro/statuses/a3aa81b5bb07f3f73b1b87ee6a5de3beea3584ef"}}}}