Repository: decorators-squad/eo-yaml
Pull request #355 (2020-06-12 13:04:39)

Fix multiline comments Issue
PR for #353 
fixes:

* Ordering of lines in a multi-line comment (they were backwards, so we had to flip them one more time)
* fixed reading of inline comments.


Patch:
diff --git a/src/main/java/com/amihaiemil/eoyaml/FirstCommentFound.java b/src/main/java/com/amihaiemil/eoyaml/FirstCommentFound.java
index a315780..47d3e7a 100644
--- a/src/main/java/com/amihaiemil/eoyaml/FirstCommentFound.java
+++ b/src/main/java/com/amihaiemil/eoyaml/FirstCommentFound.java
@@ -47,12 +47,31 @@ final class FirstCommentFound implements YamlLines {
      */
     private final YamlLines lines;
 
+    /**
+     * Are we looking for inline comments?
+     * E.g. Comments after a scalar:
+     * <pre>
+     *   some: scalar # this comment
+     * </pre>
+     */
+    private final boolean inLine;
+
     /**
      * Ctor.
      * @param lines The Yaml lines where we look for the comment.
      */
     FirstCommentFound(final YamlLines lines) {
+        this(lines, false);
+    }
+
+    /**
+     * Ctor.
+     * @param lines The Yaml lines where we look for the comment.
+     * @param inLine Looking for inline comment or not?
+     */
+    FirstCommentFound(final YamlLines lines, final boolean inLine) {
         this.lines = lines;
+        this.inLine = inLine;
     }
 
     /**
@@ -67,7 +86,11 @@ final class FirstCommentFound implements YamlLines {
             while (iterator.hasNext()) {
                 YamlLine line = iterator.next();
                 if(!line.comment().isEmpty()) {
-                    comment.add(line);
+                    if(line.trimmed().startsWith("#")) {
+                        comment.add(line);
+                    } else if(this.inLine) {
+                        comment.add(line);
+                    }
                 } else {
                     break;
                 }
diff --git a/src/main/java/com/amihaiemil/eoyaml/NoCommentsYamlLine.java b/src/main/java/com/amihaiemil/eoyaml/NoCommentsYamlLine.java
deleted file mode 100644
index 60c1a54..0000000
--- a/src/main/java/com/amihaiemil/eoyaml/NoCommentsYamlLine.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Copyright (c) 2016-2020, Mihai Emil Andronache
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- *  list of conditions and the following disclaimer.
- *  Redistributions in binary form must reproduce the above copyright notice,
- *  this list of conditions and the following disclaimer in the documentation
- *  and/or other materials provided with the distribution.
- * Neither the name of the copyright holder nor the names of its
- *  contributors may be used to endorse or promote products derived from
- *  this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-package com.amihaiemil.eoyaml;
-
-/**
- * A decorator class for YamlLine to remove comments from a given YamlLine.
- * @author Sherif Waly (sherifwaly95@gmail.com)
- * @version $Id$
- * @since 1.0.1
- *
- */
-final class NoCommentsYamlLine implements YamlLine {
-
-    /**
-     * Original line.
-     */
-    private YamlLine line;
-
-    /**
-     * Ctor.
-     * @param line Original YamlLine
-     */
-    NoCommentsYamlLine(final YamlLine line) {
-        this.line = line;
-    }
-
-    @Override
-    public int compareTo(final YamlLine other) {
-        return this.line.compareTo(other);
-    }
-
-    /**
-     * Trim the comments off.
-     * @return String
-     */
-    @Override
-    public String trimmed() {
-        String trimmed = this.line.trimmed();
-        int i = 0;
-        while(i < trimmed.length()) {
-            if(trimmed.charAt(i) == '#') {
-                trimmed = trimmed.substring(0, i);
-                break;
-            } else if(trimmed.charAt(i) == '"') {
-                i++;
-                while(i < trimmed.length() && trimmed.charAt(i) != '"') {
-                    i++;
-                }
-            } else if(trimmed.charAt(i) == '\'') {
-                i++;
-                while(i < trimmed.length() && trimmed.charAt(i) != '\'') {
-                    i++;
-                }
-            }
-            i++;
-        }
-        return trimmed.trim();
-    }
-
-    @Override
-    public String comment() {
-        return "";
-    }
-
-    @Override
-    public int number() {
-        return this.line.number();
-    }
-
-    @Override
-    public int indentation() {
-        return this.line.indentation();
-    }
-
-    @Override
-    public boolean requireNestedIndentation() {
-        return new RtYamlLine(this.trimmed(), 0).requireNestedIndentation();
-    }
-
-    @Override
-    public String toString() {
-        return this.line.toString();
-    }
-}
diff --git a/src/main/java/com/amihaiemil/eoyaml/ReadFoldedBlockScalar.java b/src/main/java/com/amihaiemil/eoyaml/ReadFoldedBlockScalar.java
index 0c945eb..34269ef 100644
--- a/src/main/java/com/amihaiemil/eoyaml/ReadFoldedBlockScalar.java
+++ b/src/main/java/com/amihaiemil/eoyaml/ReadFoldedBlockScalar.java
@@ -139,29 +139,32 @@ final class ReadFoldedBlockScalar extends BaseFoldedScalar {
 
     @Override
     public Comment comment() {
+        //@checkstyle LineLength (50 lines)
         return new ReadComment(
-            new FirstCommentFound(
-                new Backwards(
-                    new Skip(
-                        this.all,
-                        line -> {
-                            final boolean skip;
-                            if(this.previous.number() < 0) {
-                                if(this.significant.iterator().hasNext()) {
-                                    skip = line.number() >= this.significant
-                                            .iterator().next().number();
+            new Backwards(
+                new FirstCommentFound(
+                    new Backwards(
+                        new Skip(
+                            this.all,
+                            line -> {
+                                final boolean skip;
+                                if(this.previous.number() < 0) {
+                                    if(this.significant.iterator().hasNext()) {
+                                        skip = line.number() >= this.significant
+                                                .iterator().next().number();
+                                    } else {
+                                        skip = false;
+                                    }
                                 } else {
-                                    skip = false;
+                                    skip = line.number() >= this.previous.number();
                                 }
-                            } else {
-                                skip = line.number() >= this.previous.number();
-                            }
-                            return skip;
-                        },
-                        line -> line.trimmed().startsWith("---"),
-                        line -> line.trimmed().startsWith("..."),
-                        line -> line.trimmed().startsWith("%"),
-                        line -> line.trimmed().startsWith("!!")
+                                return skip;
+                            },
+                            line -> line.trimmed().startsWith("---"),
+                            line -> line.trimmed().startsWith("..."),
+                            line -> line.trimmed().startsWith("%"),
+                            line -> line.trimmed().startsWith("!!")
+                        )
                     )
                 )
             ),
diff --git a/src/main/java/com/amihaiemil/eoyaml/ReadLiteralBlockScalar.java b/src/main/java/com/amihaiemil/eoyaml/ReadLiteralBlockScalar.java
index 6747447..679f052 100644
--- a/src/main/java/com/amihaiemil/eoyaml/ReadLiteralBlockScalar.java
+++ b/src/main/java/com/amihaiemil/eoyaml/ReadLiteralBlockScalar.java
@@ -117,28 +117,31 @@ final class ReadLiteralBlockScalar extends BaseScalar {
     @Override
     public Comment comment() {
         return new ReadComment(
-            new FirstCommentFound(
-                new Backwards(
-                    new Skip(
-                        this.all,
-                        line -> {
-                            final boolean skip;
-                            if(this.previous.number() < 0) {
-                                if(this.significant.iterator().hasNext()) {
-                                    skip = line.number() >= this.significant
-                                            .iterator().next().number();
+            //@checkstyle LineLength (50 lines)
+            new Backwards(
+                new FirstCommentFound(
+                    new Backwards(
+                        new Skip(
+                            this.all,
+                            line -> {
+                                final boolean skip;
+                                if(this.previous.number() < 0) {
+                                    if(this.significant.iterator().hasNext()) {
+                                        skip = line.number() >= this.significant
+                                                .iterator().next().number();
+                                    } else {
+                                        skip = false;
+                                    }
                                 } else {
-                                    skip = false;
+                                    skip = line.number() >= this.previous.number();
                                 }
-                            } else {
-                                skip = line.number() >= this.previous.number();
-                            }
-                            return skip;
-                        },
-                        line -> line.trimmed().startsWith("---"),
-                        line -> line.trimmed().startsWith("..."),
-                        line -> line.trimmed().startsWith("%"),
-                        line -> line.trimmed().startsWith("!!")
+                                return skip;
+                            },
+                            line -> line.trimmed().startsWith("---"),
+                            line -> line.trimmed().startsWith("..."),
+                            line -> line.trimmed().startsWith("%"),
+                            line -> line.trimmed().startsWith("!!")
+                        )
                     )
                 )
             ),
diff --git a/src/main/java/com/amihaiemil/eoyaml/ReadPlainScalar.java b/src/main/java/com/amihaiemil/eoyaml/ReadPlainScalar.java
index 9aaba5d..32cf294 100644
--- a/src/main/java/com/amihaiemil/eoyaml/ReadPlainScalar.java
+++ b/src/main/java/com/amihaiemil/eoyaml/ReadPlainScalar.java
@@ -95,7 +95,8 @@ final class ReadPlainScalar extends BaseScalar {
                     new Skip(
                         this.all,
                         line -> line.number() != this.scalar.number()
-                    )
+                    ),
+                    Boolean.TRUE
                 ),
                 this
             );
diff --git a/src/main/java/com/amihaiemil/eoyaml/ReadYamlMapping.java b/src/main/java/com/amihaiemil/eoyaml/ReadYamlMapping.java
index 376539b..110ad7a 100644
--- a/src/main/java/com/amihaiemil/eoyaml/ReadYamlMapping.java
+++ b/src/main/java/com/amihaiemil/eoyaml/ReadYamlMapping.java
@@ -111,9 +111,9 @@ final class ReadYamlMapping extends BaseYamlMapping {
             } else {
                 if(!trimmed.contains(":")) {
                     throw new YamlReadingException(
-                        "Expected scalar key on line " 
+                        "Expected scalar key on line "
                         + (line.number() + 1) + "."
-                        + " The line should have the format " 
+                        + " The line should have the format "
                         + "'key: value' or 'key:'. "
                         + "Instead, the line is: "
                         + "[" + line.trimmed() + "]."
@@ -142,29 +142,32 @@ final class ReadYamlMapping extends BaseYamlMapping {
 
     @Override
     public Comment comment() {
+        //@checkstyle LineLength (50 lines)
         return new ReadComment(
-            new FirstCommentFound(
-                new Backwards(
-                    new Skip(
-                        this.all,
-                        line -> {
-                            final boolean skip;
-                            if(this.previous.number() < 0) {
-                                if(this.significant.iterator().hasNext()) {
-                                    skip = line.number() >= this.significant
-                                            .iterator().next().number();
+            new Backwards(
+                new FirstCommentFound(
+                    new Backwards(
+                        new Skip(
+                            this.all,
+                            line -> {
+                                final boolean skip;
+                                if(this.previous.number() < 0) {
+                                    if(this.significant.iterator().hasNext()) {
+                                        skip = line.number() >= this.significant
+                                                .iterator().next().number();
+                                    } else {
+                                        skip = false;
+                                    }
                                 } else {
-                                    skip = false;
+                                    skip = line.number() >= this.previous.number();
                                 }
-                            } else {
-                                skip = line.number() >= this.previous.number();
-                            }
-                            return skip;
-                        },
-                        line -> line.trimmed().startsWith("---"),
-                        line -> line.trimmed().startsWith("..."),
-                        line -> line.trimmed().startsWith("%"),
-                        line -> line.trimmed().startsWith("!!")
+                                return skip;
+                            },
+                            line -> line.trimmed().startsWith("---"),
+                            line -> line.trimmed().startsWith("..."),
+                            line -> line.trimmed().startsWith("%"),
+                            line -> line.trimmed().startsWith("!!")
+                        )
                     )
                 )
             ),
diff --git a/src/main/java/com/amihaiemil/eoyaml/ReadYamlSequence.java b/src/main/java/com/amihaiemil/eoyaml/ReadYamlSequence.java
index dcaf8cd..098ab6b 100644
--- a/src/main/java/com/amihaiemil/eoyaml/ReadYamlSequence.java
+++ b/src/main/java/com/amihaiemil/eoyaml/ReadYamlSequence.java
@@ -114,29 +114,32 @@ final class ReadYamlSequence extends BaseYamlSequence {
 
     @Override
     public Comment comment() {
+        //@checkstyle LineLength (50 lines)
         return new ReadComment(
-            new FirstCommentFound(
-                new Backwards(
-                    new Skip(
-                        this.all,
-                        line -> {
-                            final boolean skip;
-                            if(this.previous.number() < 0) {
-                                if(this.significant.iterator().hasNext()) {
-                                    skip = line.number() >= this.significant
-                                            .iterator().next().number();
+            new Backwards(
+                new FirstCommentFound(
+                    new Backwards(
+                        new Skip(
+                            this.all,
+                            line -> {
+                                final boolean skip;
+                                if(this.previous.number() < 0) {
+                                    if(this.significant.iterator().hasNext()) {
+                                        skip = line.number() >= this.significant
+                                                .iterator().next().number();
+                                    } else {
+                                        skip = false;
+                                    }
                                 } else {
-                                    skip = false;
+                                    skip = line.number() >= this.previous.number();
                                 }
-                            } else {
-                                skip = line.number() >= this.previous.number();
-                            }
-                            return skip;
-                        },
-                        line -> line.trimmed().startsWith("---"),
-                        line -> line.trimmed().startsWith("..."),
-                        line -> line.trimmed().startsWith("%"),
-                        line -> line.trimmed().startsWith("!!")
+                                return skip;
+                            },
+                            line -> line.trimmed().startsWith("---"),
+                            line -> line.trimmed().startsWith("..."),
+                            line -> line.trimmed().startsWith("%"),
+                            line -> line.trimmed().startsWith("!!")
+                        )
                     )
                 )
             ),


Test patch:
diff --git a/src/test/java/com/amihaiemil/eoyaml/NoCommentsYamlLineTest.java b/src/test/java/com/amihaiemil/eoyaml/NoCommentsYamlLineTest.java
deleted file mode 100644
index 10cfd6d..0000000
--- a/src/test/java/com/amihaiemil/eoyaml/NoCommentsYamlLineTest.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/**
- * Copyright (c) 2016-2020, Mihai Emil Andronache
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- *  list of conditions and the following disclaimer.
- *  Redistributions in binary form must reproduce the above copyright notice,
- *  this list of conditions and the following disclaimer in the documentation
- *  and/or other materials provided with the distribution.
- * Neither the name of the copyright holder nor the names of its
- *  contributors may be used to endorse or promote products derived from
- *  this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-package com.amihaiemil.eoyaml;
-
-import org.hamcrest.MatcherAssert;
-import org.hamcrest.Matchers;
-import org.junit.Test;
-
-/**
- * Unit test for {@link NoCommentsYamlLine}.
- * @author Sherif Waly (sherifwaly95@gmail.com)
- * @version $Id$
- * @since 1.0.1
- */
-public final class NoCommentsYamlLineTest {
-    /**
-     * NoCommentsYamlLine knows its number.
-     */
-    @Test
-    public void knowsNumber() {
-        YamlLine line = new NoCommentsYamlLine(new RtYamlLine("line", 11));
-        MatcherAssert.assertThat(line.number(), Matchers.is(11));
-    }
-
-    /**
-     * NoCommentsYamlLine returns its, indentation if it's right.
-     */
-    @Test
-    public void isWellIndented() {
-        YamlLine byZero = new NoCommentsYamlLine(
-            new RtYamlLine("this: line", 5)
-        );
-        MatcherAssert.assertThat(
-            byZero.indentation(), Matchers.is(0)
-        );
-        YamlLine byFour = new NoCommentsYamlLine(
-                new RtYamlLine("    this: line", 10)
-        );
-        MatcherAssert.assertThat(
-            byFour.indentation(), Matchers.is(4)
-        );
-    }
-
-    /**
-     * NoCommentsYamlLine compares right with other lines.
-     */
-    @Test
-    public void comparesRight() {
-        YamlLine noComments = new NoCommentsYamlLine(
-            new RtYamlLine("abc", 1)
-        );
-        YamlLine normalLine = new RtYamlLine("  no", 2);
-        MatcherAssert.assertThat(
-            noComments.compareTo(normalLine) < 0, Matchers.is(true)
-        );
-    }
-
-    /**
-     * NoCommentsYamlLine trims a comment line and return empty line.
-     */
-    @Test
-    public void trimsCommentsLine() {
-        YamlLine noComments = new NoCommentsYamlLine(
-            new RtYamlLine("   #this is a comment line", 1)
-        );
-        MatcherAssert.assertThat(
-            noComments.trimmed(), Matchers.is("")
-        );
-    }
-
-    /**
-     * NoCommentsYamlLine removes only comments and leave original string.
-     */
-    @Test
-    public void trimsCommentsAtEndOfLineWithoutQuotes() {
-        YamlLine noComments = new NoCommentsYamlLine(
-            new RtYamlLine("  this isnt a comment   #here is the comment", 1)
-        );
-        MatcherAssert.assertThat(
-            noComments.trimmed(), Matchers.is("this isnt a comment")
-        );
-    }
-
-    /**
-     * NoCommentsYamlLine removes only comments and leaves original string.
-     * Original string has quotes.
-     */
-    @Test
-    public void trimsCommentsAtEndOfLineWithQuotes() {
-        YamlLine noComments = new NoCommentsYamlLine(
-            new RtYamlLine("  \"this isn't comment\"   #here is the comment", 1)
-        );
-        MatcherAssert.assertThat(
-            noComments.trimmed(), Matchers.is("\"this isn't comment\"")
-        );
-    }
-
-    /**
-     * NoCommentsYamlLine doesn't remove escaped # in a string.
-     */
-    @Test
-    public void doesNotTrimQuotesEscapedHash() {
-        YamlLine noComments = new NoCommentsYamlLine(
-            new RtYamlLine("  value: \"this isn't mambo #5\" ", 2)
-        );
-        MatcherAssert.assertThat(
-            noComments.trimmed(), Matchers.is("value: \"this isn't mambo #5\"")
-        );
-    }
-    
-    /**
-     * NoCommentsYamlLine doesn't remove escaped # in a string.
-     */
-    @Test
-    public void doesNotTrimApostropheEscapedHash() {
-        YamlLine noComments = new NoCommentsYamlLine(
-            new RtYamlLine("  value: '#5' ", 2)
-        );
-        MatcherAssert.assertThat(
-            noComments.trimmed(), Matchers.is("value: '#5'")
-        );
-    }
-}
diff --git a/src/test/java/com/amihaiemil/eoyaml/YamlMappingCommentsPrintTest.java b/src/test/java/com/amihaiemil/eoyaml/YamlMappingCommentsPrintTest.java
index 602015b..dd96327 100644
--- a/src/test/java/com/amihaiemil/eoyaml/YamlMappingCommentsPrintTest.java
+++ b/src/test/java/com/amihaiemil/eoyaml/YamlMappingCommentsPrintTest.java
@@ -122,6 +122,47 @@ public final class YamlMappingCommentsPrintTest {
         );
     }
 
+    /**
+     * A read YamlMapping can access its comments.
+     * @throws Exception If something goes wrong.
+     */
+    @Test
+    public void readsMultilineComments() throws Exception {
+        final YamlMapping read = Yaml.createYamlInput(
+            new File(
+                "src/test/resources/multilineCommentedMapping.yml"
+            )
+        ).readYamlMapping();
+        MatcherAssert.assertThat(
+            read.comment().value(),
+            Matchers.equalTo("YamlMapping for test")
+        );
+        MatcherAssert.assertThat(
+            read.yamlSequence("developers").comment().value(),
+            Matchers.equalTo("all the contributors here")
+        );
+        MatcherAssert.assertThat(
+            read.value("name").comment().value(),
+            Matchers.equalTo("name of the project")
+        );
+        MatcherAssert.assertThat(
+            read.value("devops").comment().value(),
+            Matchers.equalTo(
+            "Our DevOps contributors."
+                + System.lineSeparator()
+                + "They are chatbots."
+            )
+        );
+        MatcherAssert.assertThat(
+            read.value("platform").comment().value(),
+            Matchers.equalTo(
+            "The project is hosted at Github"
+                + System.lineSeparator()
+                + "under the \"decorators-squad\" Organization"
+            )
+        );
+    }
+
     /**
      * Read a test resource file's contents.
      * @param fileName File to read.
diff --git a/src/test/resources/multilineCommentedMapping.yml b/src/test/resources/multilineCommentedMapping.yml
new file mode 100644
index 0000000..02a04a4
--- /dev/null
+++ b/src/test/resources/multilineCommentedMapping.yml
@@ -0,0 +1,20 @@
+# YamlMapping for test
+architect: mihai
+# all the contributors here
+developers:
+  - rultor
+  - salikjan
+  - sherif
+# Our DevOps contributors.
+# They are chatbots.
+devops:
+  - rultor
+  - travis
+  - 0pdd
+name: "eo-yaml" # name of the project
+# The project is hosted at Github
+# under the "decorators-squad" Organization
+platform:
+  name: Github
+  issues: "https://github.com/decorators-squad/eo-yaml/issues"
+  code: "https://github.com/decorators-squad/eo-yaml"
diff --git a/src/test/resources/ticket353_comments.yml b/src/test/resources/ticket353_comments.yml
new file mode 100644
index 0000000..4234a14
--- /dev/null
+++ b/src/test/resources/ticket353_comments.yml
@@ -0,0 +1,10 @@
+---
+# project comments
+name: "Manager" #inline comment
+# test command
+# multi line comments
+owners:
+  - vikas #test list
+  - nikhil
+identifier: "manager" # identifier
+description: "Test app" # final comment