Repository: reata/sqllineage

Issue:
Trim Leading Comment for Statement in Verbose Output
```
sqllineage -v -e "------------------------                    
dquote> select * from dual"
Statement #1: ------------------------select * from dual
table read: {Table: <unknown>.dual}
table write: {}
table rename: {}
table drop: {}
table with_: {}
==========
Summary:
Statements(#): 1
Source Tables:
    <unknown>.dual
Target Tables:
```

We should trim the leading comment line when showing statement.

Discussion:

Patch:
diff --git a/sqllineage/runner.py b/sqllineage/runner.py
index 643bfc4..20705f7 100644
--- a/sqllineage/runner.py
+++ b/sqllineage/runner.py
@@ -29,7 +29,7 @@ class LineageRunner(object):
         self._verbose = verbose
 
     def __str__(self):
-        statements = self.statements
+        statements = self.statements(strip_comments=True)
         combined = """Statements(#): {stmt_cnt}
 Source Tables:
     {source_tables}
@@ -58,9 +58,8 @@ Target Tables:
     def statements_parsed(self) -> List[Statement]:
         return self._stmt
 
-    @property
-    def statements(self) -> List[str]:
-        return [sqlparse.format(s.value) for s in self.statements_parsed]
+    def statements(self, **kwargs) -> List[str]:
+        return [sqlparse.format(s.value, **kwargs) for s in self.statements_parsed]
 
     @property
     def source_tables(self) -> Set[Table]:


Test patch:
diff --git a/tests/test_others.py b/tests/test_others.py
index 863e1d0..2468ef5 100644
--- a/tests/test_others.py
+++ b/tests/test_others.py
@@ -101,30 +101,36 @@ def test_delete_from_table():
 
 def test_split_statements():
     sql = "SELECT * FROM tab1; SELECT * FROM tab2;"
-    assert len(LineageRunner(sql).statements) == 2
+    assert len(LineageRunner(sql).statements()) == 2
 
 
 def test_split_statements_with_heading_and_ending_new_line():
     sql = "\nSELECT * FROM tab1;\nSELECT * FROM tab2;\n"
-    assert len(LineageRunner(sql).statements) == 2
+    assert len(LineageRunner(sql).statements()) == 2
 
 
 def test_split_statements_with_comment():
     sql = """SELECT 1;
 
 -- SELECT 2;"""
-    assert len(LineageRunner(sql).statements) == 1
+    assert len(LineageRunner(sql).statements()) == 1
+
+
+def test_statements_trim_comment():
+    comment = "------------------\n"
+    sql = "select * from dual;"
+    assert LineageRunner(comment + sql).statements(strip_comments=True)[0] == sql
 
 
 def test_split_statements_with_show_create_table():
     sql = """SELECT 1;
 
 SHOW CREATE TABLE tab1;"""
-    assert len(LineageRunner(sql).statements) == 2
+    assert len(LineageRunner(sql).statements()) == 2
 
 
 def test_split_statements_with_desc():
     sql = """SELECT 1;
 
 DESC tab1;"""
-    assert len(LineageRunner(sql).statements) == 2
+    assert len(LineageRunner(sql).statements()) == 2