From 323934639fb8444a3cb77633932c3dd685e39bb8 Mon Sep 17 00:00:00 2001 From: Luca Corbatto Date: Thu, 9 Dec 2021 10:49:04 +0100 Subject: [PATCH] Fixes #44 (#45) Now emits newlines at the end of imports and includes Signed-off-by: Luca Corbatto --- ast/rules.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ast/rules.go b/ast/rules.go index dd59e34..b9ba3d9 100644 --- a/ast/rules.go +++ b/ast/rules.go @@ -75,12 +75,12 @@ func (r *Rule) WriteSource(w io.Writer) error { // WriteSource writes the ruleset's source into the writer w. func (r *RuleSet) WriteSource(w io.Writer) error { for _, imp := range r.Imports { - if _, err := fmt.Fprintf(w, `import "%s"`, imp); err != nil { + if _, err := fmt.Fprintf(w, "import \"%s\"\n", imp); err != nil { return err } } for _, inc := range r.Includes { - if _, err := fmt.Fprintf(w, `include "%s"`, inc); err != nil { + if _, err := fmt.Fprintf(w, "include \"%s\"\n", inc); err != nil { return err } }