libyang FORMAT uncrustify format of all sources
diff --git a/compat/compat.c b/compat/compat.c
index 7a06d58..a959447 100644
--- a/compat/compat.c
+++ b/compat/compat.c
@@ -39,6 +39,7 @@
     }
     return count;
 }
+
 #endif
 
 #ifndef HAVE_ASPRINTF
@@ -53,6 +54,7 @@
     va_end(ap);
     return ret;
 }
+
 #endif
 
 #ifndef HAVE_VASPRINTF
@@ -70,6 +72,7 @@
 
     return vsnprintf(*strp, l + 1U, fmt, ap);
 }
+
 #endif
 
 #ifndef HAVE_STRNDUP
@@ -90,6 +93,7 @@
     buf[len] = '\0';
     return buf;
 }
+
 #endif
 
 #ifndef HAVE_STRNSTR
@@ -115,6 +119,7 @@
     }
     return (char *)s;
 }
+
 #endif
 
 #ifndef HAVE_GETLINE
@@ -157,6 +162,7 @@
     strcpy(*lineptr, line);
     return len;
 }
+
 #endif
 
 #ifndef HAVE_GET_CURRENT_DIR_NAME
@@ -175,4 +181,5 @@
 
     return retval;
 }
+
 #endif
diff --git a/src/common.c b/src/common.c
index fcde3d8..c6d3b6a 100644
--- a/src/common.c
+++ b/src/common.c
@@ -568,8 +568,8 @@
 
 LY_ERR
 ly_parse_instance_predicate(const char **pred, size_t limit, LYD_FORMAT format,
-                            const char **prefix, size_t *prefix_len, const char **id, size_t *id_len, const char **value, size_t *value_len,
-                            const char **errmsg)
+        const char **prefix, size_t *prefix_len, const char **id, size_t *id_len, const char **value, size_t *value_len,
+        const char **errmsg)
 {
     LY_ERR ret = LY_EVALID;
     const char *in = *pred;
@@ -647,7 +647,7 @@
             goto error;
         }
         *value = &in[offset];
-        for (;offset < limit && (in[offset] != quot || (offset && in[offset - 1] == '\\')); offset++) {}
+        for (; offset < limit && (in[offset] != quot || (offset && in[offset - 1] == '\\')); offset++) {}
         if (in[offset] == quot) {
             *value_len = &in[offset] - *value;
             offset++;
diff --git a/src/common.h b/src/common.h
index 802ede2..5f944a3 100644
--- a/src/common.h
+++ b/src/common.h
@@ -33,8 +33,8 @@
 #if __STDC_VERSION__ >= 201112 && !defined __STDC_NO_THREADS__
 # define THREAD_LOCAL _Thread_local
 #elif defined __GNUC__ || \
-      defined __SUNPRO_C || \
-      defined __xlC__
+    defined __SUNPRO_C || \
+    defined __xlC__
 # define THREAD_LOCAL __thread
 #else
 # error "Cannot define THREAD_LOCAL"
@@ -53,7 +53,6 @@
  */
 #define API __attribute__((visibility("default")))
 
-
 /******************************************************************************
  * Logger
  *****************************************************************************/
@@ -106,7 +105,7 @@
 #ifdef NDEBUG
 #  define LOGDBG(dbg_group, str, ...)
 #else
-   void ly_log_dbg(int group, const char *format, ...);
+void ly_log_dbg(int group, const char *format, ...);
 #  define LOGDBG(dbg_group, str, ...) ly_log_dbg(dbg_group, str, ##__VA_ARGS__);
 #endif
 
@@ -453,8 +452,8 @@
  * @return LY_EINVAL in case of reaching @p limit when parsing @p pred.
  */
 LY_ERR ly_parse_instance_predicate(const char **pred, size_t limit, LYD_FORMAT format,
-                                   const char **prefix, size_t *prefix_len, const char **id, size_t *id_len,
-                                   const char **value, size_t *value_len, const char **errmsg);
+        const char **prefix, size_t *prefix_len, const char **id, size_t *id_len,
+        const char **value, size_t *value_len, const char **errmsg);
 
 /**
  * @brief mmap(2) wrapper to map input files into memory to unify parsing.
diff --git a/src/context.c b/src/context.c
index 5ddfded..8de2f82 100644
--- a/src/context.c
+++ b/src/context.c
@@ -267,6 +267,7 @@
     ly_ctx_destroy(ctx, NULL);
     return rc;
 }
+
 API int
 ly_ctx_get_options(const struct ly_ctx *ctx)
 {
@@ -638,7 +639,7 @@
             LY_CHECK_RET(lyd_new_term(parent, NULL, "deviation", mod->name, NULL));
         } else {
             LY_CHECK_RET(lyd_new_list(parent, NULL, "deviation", NULL, mod->name,
-                                      (mod->parsed->revs ? mod->parsed->revs[0].date : "")));
+                    (mod->parsed->revs ? mod->parsed->revs[0].date : "")));
         }
     }
 
@@ -666,7 +667,7 @@
             }
         } else {
             LY_CHECK_RET(lyd_new_list(parent, NULL, "submodule", &cont, submod->name,
-                                      (submod->revs ? submod->revs[0].date : "")));
+                    (submod->revs ? submod->revs[0].date : "")));
         }
 
         if (submod->filepath) {
@@ -726,7 +727,7 @@
          * deprecated legacy
          */
         LY_CHECK_GOTO(ret = lyd_new_list(root, NULL, "module", &cont, mod->name,
-                                         (mod->parsed->revs ? mod->parsed->revs[0].date : "")), error);
+                (mod->parsed->revs ? mod->parsed->revs[0].date : "")), error);
 
         /* schema */
         if (mod->filepath) {
@@ -767,7 +768,7 @@
                 }
             } else {
                 LY_CHECK_GOTO(ret = lyd_new_list(set_bis, NULL, "import-only-module", &cont, mod->name,
-                                                 (mod->parsed->revs ? mod->parsed->revs[0].date : "")), error);
+                        (mod->parsed->revs ? mod->parsed->revs[0].date : "")), error);
             }
 
             /* namespace */
diff --git a/src/context.h b/src/context.h
index 7100263..f580703 100644
--- a/src/context.h
+++ b/src/context.h
@@ -301,8 +301,8 @@
  * according to the settings of its mechanism to search for the imported/included schemas.
  */
 typedef LY_ERR (*ly_module_imp_clb)(const char *mod_name, const char *mod_rev, const char *submod_name, const char *sub_rev,
-                                    void *user_data, LYS_INFORMAT *format, const char **module_data,
-                                    void (**free_module_data)(void *model_data, void *user_data));
+        void *user_data, LYS_INFORMAT *format, const char **module_data,
+        void (**free_module_data)(void *model_data, void *user_data));
 
 /**
  * @brief Get the custom callback for missing import/include module retrieval.
@@ -411,7 +411,7 @@
  * @return Found schema node or NULL.
  */
 const struct lysc_node *ly_ctx_get_node(const struct ly_ctx *ctx, const struct lysc_node *ctx_node,
-                                        const char *data_path, int output);
+        const char *data_path, int output);
 
 /**
  * @brief Reset cached latest revision information of the schemas in the context.
diff --git a/src/diff.c b/src/diff.c
index 09ea1fb..57f25e2 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -68,7 +68,7 @@
 
 LY_ERR
 lyd_diff_add(const struct lyd_node *node, enum lyd_diff_op op, const char *orig_default, const char *orig_value,
-             const char *key, const char *value, const char *orig_key, struct lyd_node **diff)
+        const char *key, const char *value, const char *orig_key, struct lyd_node **diff)
 {
     struct lyd_node *dup, *siblings, *match = NULL, *diff_parent = NULL;
     const struct lyd_node *parent = NULL;
@@ -232,8 +232,8 @@
  */
 static LY_ERR
 lyd_diff_userord_attrs(const struct lyd_node *first, const struct lyd_node *second, int options,
-                       struct lyd_diff_userord **userord, enum lyd_diff_op *op, const char **orig_default, char **value,
-                       char **orig_value, char **key, char **orig_key)
+        struct lyd_diff_userord **userord, enum lyd_diff_op *op, const char **orig_default, char **value,
+        char **orig_value, char **key, char **orig_key)
 {
     const struct lysc_node *schema;
     size_t buflen, bufused, first_pos, second_pos;
@@ -395,7 +395,7 @@
  */
 static LY_ERR
 lyd_diff_attrs(const struct lyd_node *first, const struct lyd_node *second, int options, enum lyd_diff_op *op,
-               const char **orig_default, char **orig_value)
+        const char **orig_default, char **orig_value)
 {
     const struct lysc_node *schema;
 
@@ -517,7 +517,7 @@
  */
 static LY_ERR
 lyd_diff_siblings_r(const struct lyd_node *first, const struct lyd_node *second, int options, int nosiblings,
-                    struct lyd_node **diff)
+        struct lyd_node **diff)
 {
     LY_ERR ret = LY_SUCCESS;
     const struct lyd_node *iter_first, *iter_second;
@@ -771,7 +771,7 @@
  */
 static LY_ERR
 lyd_diff_insert(struct lyd_node **first_node, struct lyd_node *parent_node, struct lyd_node *new_node,
-                const char *key_or_value)
+        const char *key_or_value)
 {
     LY_ERR ret;
     struct lyd_node *anchor;
@@ -851,7 +851,7 @@
  */
 static LY_ERR
 lyd_diff_apply_r(struct lyd_node **first_node, struct lyd_node *parent_node, const struct lyd_node *diff_node,
-                 lyd_diff_cb diff_cb, void *cb_data)
+        lyd_diff_cb diff_cb, void *cb_data)
 {
     LY_ERR ret;
     struct lyd_node *match, *diff_child;
@@ -980,7 +980,7 @@
 
 API LY_ERR
 lyd_diff_apply_module(struct lyd_node **data, const struct lyd_node *diff, const struct lys_module *mod,
-                      lyd_diff_cb diff_cb, void *cb_data)
+        lyd_diff_cb diff_cb, void *cb_data)
 {
     const struct lyd_node *root;
 
@@ -1286,7 +1286,7 @@
     case LYD_DIFF_OP_REPLACE:
         /* similar to none operation but also remove the redundant attribute */
         lyd_diff_del_meta(diff_match, "orig-value");
-        /* fallthrough */
+    /* fallthrough */
     case LYD_DIFF_OP_NONE:
         /* it was not modified, but should be deleted -> set DELETE operation */
         LY_CHECK_RET(lyd_diff_change_op(diff_match, LYD_DIFF_OP_DELETE));
@@ -1387,7 +1387,7 @@
  */
 static LY_ERR
 lyd_diff_merge_r(const struct lyd_node *src_diff, struct lyd_node *diff_parent, lyd_diff_cb diff_cb, void *cb_data,
-                 struct lyd_node **diff)
+        struct lyd_node **diff)
 {
     LY_ERR ret = LY_SUCCESS;
     struct lyd_node *child, *diff_node = NULL;
@@ -1471,7 +1471,7 @@
 
 API LY_ERR
 lyd_diff_merge_module(struct lyd_node **diff, const struct lyd_node *src_diff, const struct lys_module *mod,
-                      lyd_diff_cb diff_cb, void *cb_data)
+        lyd_diff_cb diff_cb, void *cb_data)
 {
     const struct lyd_node *src_root;
 
@@ -1490,7 +1490,7 @@
 
 API LY_ERR
 lyd_diff_merge_tree(struct lyd_node **diff_first, struct lyd_node *diff_parent, const struct lyd_node *src_sibling,
-                    lyd_diff_cb diff_cb, void *cb_data)
+        lyd_diff_cb diff_cb, void *cb_data)
 {
     if (!src_sibling) {
         return LY_SUCCESS;
diff --git a/src/diff.h b/src/diff.h
index d6cd5af..dbfa37c 100644
--- a/src/diff.h
+++ b/src/diff.h
@@ -54,6 +54,6 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_diff_add(const struct lyd_node *node, enum lyd_diff_op op, const char *orig_default, const char *orig_value,
-                    const char *key, const char *value, const char *orig_key, struct lyd_node **diff);
+        const char *key, const char *value, const char *orig_key, struct lyd_node **diff);
 
 #endif /* LY_DIFF_H_ */
diff --git a/src/hash_table.c b/src/hash_table.c
index 5eee58b..928a963 100644
--- a/src/hash_table.c
+++ b/src/hash_table.c
@@ -488,7 +488,7 @@
  */
 static LY_ERR
 lyht_find_rec(struct hash_table *ht, void *val_p, uint32_t hash, int mod, struct ht_rec **crec_p, uint32_t *col,
-              struct ht_rec **rec_p)
+        struct ht_rec **rec_p)
 {
     struct ht_rec *rec, *crec;
     uint32_t i, c;
@@ -591,7 +591,7 @@
 
 LY_ERR
 lyht_insert_with_resize_cb(struct hash_table *ht, void *val_p, uint32_t hash,
-                           values_equal_cb resize_val_equal, void **match_p)
+        values_equal_cb resize_val_equal, void **match_p)
 {
     struct ht_rec *rec, *crec = NULL;
     int32_t i;
diff --git a/src/hash_table.h b/src/hash_table.h
index 9958c98..dde9570 100644
--- a/src/hash_table.h
+++ b/src/hash_table.h
@@ -215,7 +215,7 @@
  * @return LY_EEXIST if the value is already present.
  */
 LY_ERR lyht_insert_with_resize_cb(struct hash_table *ht, void *val_p, uint32_t hash, values_equal_cb resize_val_equal,
-                                  void **match_p);
+        void **match_p);
 
 /**
  * @brief Remove a value from a hash table.
diff --git a/src/json.c b/src/json.c
index 3a449e6..c13fab7 100644
--- a/src/json.c
+++ b/src/json.c
@@ -386,7 +386,6 @@
             return LY_EVALID;
         }
 
-
         dec_point = ly_strnchr(in, '.', exponent);
         if (!dec_point) {
             /* value is integer, we are just ... */
@@ -785,4 +784,3 @@
 
     free(jsonctx);
 }
-
diff --git a/src/log.c b/src/log.c
index 3ae4f70..4991622 100644
--- a/src/log.c
+++ b/src/log.c
@@ -291,7 +291,7 @@
 
 static void
 log_vprintf(const struct ly_ctx *ctx, LY_LOG_LEVEL level, LY_ERR no, LY_VECODE vecode, char *path,
-            const char *format, va_list args)
+        const char *format, va_list args)
 {
     char *msg = NULL;
     int free_strs;
@@ -413,7 +413,7 @@
         LY_CHECK_ERR_RET(!(*path), LOGMEM(ctx), LY_EMEM);
         break;
     case LY_VLOG_LINE:
-        rc = asprintf(path, "Line number %"PRIu64".", *((uint64_t*)elem));
+        rc = asprintf(path, "Line number %" PRIu64 ".", *((uint64_t*)elem));
         LY_CHECK_ERR_RET(rc == -1, LOGMEM(ctx), LY_EMEM);
         break;
     case LY_VLOG_LYSC:
diff --git a/src/parser.c b/src/parser.c
index a54dce7..fb95fe8 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -176,7 +176,7 @@
 API LY_ERR
 ly_in_new_filepath(const char *filepath, size_t len, struct ly_in **in)
 {
-	LY_ERR ret;
+    LY_ERR ret;
     char *fp;
     int fd;
 
@@ -407,7 +407,7 @@
 
 LY_ERR
 lyd_parser_create_term(struct lyd_ctx *lydctx, const struct lysc_node *schema, const char *value, size_t value_len,
-                       int *dynamic, int value_hints, LY_PREFIX_FORMAT format, void *prefix_data, struct lyd_node **node)
+        int *dynamic, int value_hints, LY_PREFIX_FORMAT format, void *prefix_data, struct lyd_node **node)
 {
     LY_ERR ret;
 
@@ -423,8 +423,8 @@
 
 LY_ERR
 lyd_parser_create_meta(struct lyd_ctx *lydctx, struct lyd_node *parent, struct lyd_meta **meta, const struct lys_module *mod,
-                       const char *name, size_t name_len, const char *value, size_t value_len, int *dynamic, int value_hints,
-                       LY_PREFIX_FORMAT format, void *prefix_data, const struct lysc_node *ctx_snode)
+        const char *name, size_t name_len, const char *value, size_t value_len, int *dynamic, int value_hints,
+        LY_PREFIX_FORMAT format, void *prefix_data, const struct lysc_node *ctx_snode)
 {
     LY_ERR ret;
     ret = lyd_create_meta(parent, meta, mod, name, name_len, value, value_len, dynamic, value_hints, format, prefix_data,
diff --git a/src/parser_data.h b/src/parser_data.h
index a2bac8b..000f25f 100644
--- a/src/parser_data.h
+++ b/src/parser_data.h
@@ -73,7 +73,6 @@
                                                  revision. */
 /** @} dataparseroptions */
 
-
 /**
  * @defgroup datavalidationoptions Data validation options
  * @ingroup datatree
@@ -131,7 +130,7 @@
  * @return LY_ERR value in case of error. Additional error information can be obtained from the context using ly_err* functions.
  */
 LY_ERR lyd_parse_data(const struct ly_ctx *ctx, struct ly_in *in, LYD_FORMAT format, int parse_options,
-                      int validate_options, struct lyd_node **tree);
+        int validate_options, struct lyd_node **tree);
 
 /**
  * @brief Parse (and validate) input data as a YANG data tree.
@@ -149,7 +148,7 @@
  * @return LY_ERR value in case of error. Additional error information can be obtained from the context using ly_err* functions.
  */
 LY_ERR lyd_parse_data_mem(const struct ly_ctx *ctx, const char *data, LYD_FORMAT format, int parse_options,
-                          int validate_options, struct lyd_node **tree);
+        int validate_options, struct lyd_node **tree);
 
 /**
  * @brief Parse (and validate) input data as a YANG data tree.
@@ -167,7 +166,7 @@
  * @return LY_ERR value in case of error. Additional error information can be obtained from the context using ly_err* functions.
  */
 LY_ERR lyd_parse_data_fd(const struct ly_ctx *ctx, int fd, LYD_FORMAT format, int parse_options, int validate_options,
-                         struct lyd_node **tree);
+        struct lyd_node **tree);
 
 /**
  * @brief Parse (and validate) input data as a YANG data tree.
@@ -185,7 +184,7 @@
  * @return LY_ERR value in case of error. Additional error information can be obtained from the context using ly_err* functions.
  */
 LY_ERR lyd_parse_data_path(const struct ly_ctx *ctx, const char *path, LYD_FORMAT format, int parse_options,
-                           int validate_options, struct lyd_node **tree);
+        int validate_options, struct lyd_node **tree);
 
 /**
  * @brief Parse (and validate) data from the input handler as a YANG RPC/action invocation.
@@ -205,7 +204,7 @@
  * @return LY_ERR value in case of error. Additional error information can be obtained from the context using ly_err* functions.
  */
 LY_ERR lyd_parse_rpc(const struct ly_ctx *ctx, struct ly_in *in, LYD_FORMAT format, struct lyd_node **tree,
-                     struct lyd_node **op);
+        struct lyd_node **op);
 
 /**
  * @brief Parse (and validate) data from the input handler as a YANG RPC/action reply.
@@ -227,7 +226,7 @@
  * @return LY_ERR value in case of error. Additional error information can be obtained from the request's context using ly_err* functions.
  */
 LY_ERR lyd_parse_reply(const struct lyd_node *request, struct ly_in *in, LYD_FORMAT format, struct lyd_node **tree,
-                       struct lyd_node **op);
+        struct lyd_node **op);
 
 /**
  * @brief Parse XML string as YANG notification.
@@ -245,7 +244,7 @@
  * @return LY_ERR value in case of error. Additional error information can be obtained from the context using ly_err* functions.
  */
 LY_ERR lyd_parse_notif(const struct ly_ctx *ctx, struct ly_in *in, LYD_FORMAT format, struct lyd_node **tree,
-                       struct lyd_node **ntf);
+        struct lyd_node **ntf);
 
 /**
  * @brief Fully validate a data tree.
diff --git a/src/parser_internal.h b/src/parser_internal.h
index d9ee1b8..d547913 100644
--- a/src/parser_internal.h
+++ b/src/parser_internal.h
@@ -118,7 +118,7 @@
  * @return LY_ERR value - LY_SUCCESS, LY_EINVAL or LY_EVALID.
  */
 LY_ERR yang_parse_submodule(struct lys_yang_parser_ctx **context, struct ly_ctx *ly_ctx, struct lys_parser_ctx *main_ctx,
-                            struct ly_in *in, struct lysp_submodule **submod);
+        struct ly_in *in, struct lysp_submodule **submod);
 
 /**
  * @brief Parse module from YANG data.
@@ -153,7 +153,7 @@
  * @return LY_ERR values.
  */
 LY_ERR yin_parse_submodule(struct lys_yin_parser_ctx **yin_ctx, struct ly_ctx *ctx, struct lys_parser_ctx *main_ctx,
-                           struct ly_in *in, struct lysp_submodule **submod);
+        struct ly_in *in, struct lysp_submodule **submod);
 
 /**
  * @brief Check that a data node representing the @p snode is suitable based on options.
@@ -171,7 +171,7 @@
  * @param[in] value_hints Data parser's hint for the value's type.
  */
 LY_ERR lyd_parser_create_term(struct lyd_ctx *lydctx, const struct lysc_node *schema, const char *value, size_t value_len,
-                              int *dynamic, int value_hints, LY_PREFIX_FORMAT format, void *prefix_data, struct lyd_node **node);
+        int *dynamic, int value_hints, LY_PREFIX_FORMAT format, void *prefix_data, struct lyd_node **node);
 
 /**
  * @brief Wrapper around lyd_create_meta() for data parsers.
@@ -180,8 +180,8 @@
  * @param[in] value_hints [Value hint](@ref lydvalueparseopts) from the parser regarding the value type.
  */
 LY_ERR lyd_parser_create_meta(struct lyd_ctx *lydctx, struct lyd_node *parent, struct lyd_meta **meta,
-                              const struct lys_module *mod, const char *name, size_t name_len, const char *value,
-                              size_t value_len, int *dynamic, int value_hints, LY_PREFIX_FORMAT format,
-                              void *prefix_data, const struct lysc_node *ctx_snode);
+        const struct lys_module *mod, const char *name, size_t name_len, const char *value,
+        size_t value_len, int *dynamic, int value_hints, LY_PREFIX_FORMAT format,
+        void *prefix_data, const struct lysc_node *ctx_snode);
 
 #endif /* LY_PARSER_INTERNAL_H_ */
diff --git a/src/parser_json.c b/src/parser_json.c
index 788a6c3..57d1592 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -86,7 +86,7 @@
  */
 static void
 lydjson_parse_name(const char *value, size_t value_len, const char **name_p, size_t *name_len_p, const char **prefix_p,
-                   size_t *prefix_len_p, int *is_meta_p)
+        size_t *prefix_len_p, int *is_meta_p)
 {
     const char *name, *prefix = NULL;
     size_t name_len, prefix_len = 0;
@@ -132,7 +132,7 @@
  */
 static LY_ERR
 lydjson_get_node_prefix(struct lyd_node *node, const char *local_prefix, size_t local_prefix_len, const char **prefix_p,
-                        size_t *prefix_len_p)
+        size_t *prefix_len_p)
 {
     struct lyd_node_opaq *onode;
     const char *module_name = NULL;
@@ -184,7 +184,7 @@
  */
 static LY_ERR
 lydjson_get_snode(const struct lyd_json_ctx *lydctx, int is_attr, const char *prefix, size_t prefix_len, const char *name,
-                  size_t name_len, const struct lyd_node_inner *parent, const struct lysc_node **snode_p)
+        size_t name_len, const struct lyd_node_inner *parent, const struct lysc_node **snode_p)
 {
     struct lys_module *mod = NULL;
 
@@ -921,8 +921,8 @@
  */
 static LY_ERR
 lydjson_parse_opaq(struct lyd_json_ctx *lydctx, const char *name, size_t name_len, const char *prefix, size_t prefix_len,
-                   struct lyd_node_inner *parent, enum LYJSON_PARSER_STATUS *status_p,
-                   enum LYJSON_PARSER_STATUS *status_inner_p, struct lyd_node **first_p, struct lyd_node **node_p)
+        struct lyd_node_inner *parent, enum LYJSON_PARSER_STATUS *status_p,
+        enum LYJSON_PARSER_STATUS *status_inner_p, struct lyd_node **first_p, struct lyd_node **node_p)
 {
     LY_ERR ret = LY_SUCCESS;
     const char *value = NULL, *module_name;
@@ -1011,9 +1011,9 @@
  */
 static LY_ERR
 lydjson_parse_attribute(struct lyd_json_ctx *lydctx, struct lyd_node *attr_node, const struct lysc_node *snode,
-                        const char *name, size_t name_len, const char *prefix, size_t prefix_len,
-                        struct lyd_node_inner *parent, enum LYJSON_PARSER_STATUS *status_p, struct lyd_node **first_p,
-                        struct lyd_node **node_p)
+        const char *name, size_t name_len, const char *prefix, size_t prefix_len,
+        struct lyd_node_inner *parent, enum LYJSON_PARSER_STATUS *status_p, struct lyd_node **first_p,
+        struct lyd_node **node_p)
 {
     LY_ERR ret = LY_SUCCESS;
     enum LYJSON_PARSER_STATUS status_inner;
@@ -1082,8 +1082,8 @@
  */
 static LY_ERR
 lydjson_parse_instance(struct lyd_json_ctx *lydctx, struct lyd_node_inner *parent, struct lyd_node **first_p,
-                       const struct lysc_node *snode, const char *name, size_t name_len, const char *prefix, size_t prefix_len,
-                       enum LYJSON_PARSER_STATUS *status, struct lyd_node **node)
+        const struct lysc_node *snode, const char *name, size_t name_len, const char *prefix, size_t prefix_len,
+        enum LYJSON_PARSER_STATUS *status, struct lyd_node **node)
 {
     LY_ERR ret;
     int type_hint;
@@ -1369,7 +1369,7 @@
  */
 static LY_ERR
 lyd_parse_json_init(const struct ly_ctx *ctx, struct ly_in *in, int parse_options, int validate_options,
-                    struct lyd_json_ctx **lydctx_p)
+        struct lyd_json_ctx **lydctx_p)
 {
     LY_ERR ret = LY_SUCCESS;
     struct lyd_json_ctx *lydctx;
@@ -1406,7 +1406,7 @@
 
 LY_ERR
 lyd_parse_json_data(const struct ly_ctx *ctx, struct ly_in *in, int parse_options, int validate_options,
-                    struct lyd_node **tree_p, struct lyd_ctx **lydctx_p)
+        struct lyd_node **tree_p, struct lyd_ctx **lydctx_p)
 {
     LY_ERR ret = LY_SUCCESS;
     struct lyd_json_ctx *lydctx = NULL;
@@ -1436,7 +1436,7 @@
 cleanup:
     /* there should be no unresolved types stored */
     assert(!(parse_options & LYD_PARSE_ONLY) || (!lydctx->unres_node_type.count && !lydctx->unres_meta_type.count
-           && !lydctx->when_check.count));
+            && !lydctx->when_check.count));
 
     if (ret) {
         lyd_json_ctx_free((struct lyd_ctx *)lydctx);
@@ -1626,7 +1626,7 @@
  */
 static LY_ERR
 lydjson_object_envelope(struct lyjson_ctx *jsonctx, struct lyd_node *parent, const char *module_key,
-                        const char *object_id, struct lyd_node **envp_p)
+        const char *object_id, struct lyd_node **envp_p)
 {
     LY_ERR ret = LY_ENOT, r;
     const char *name, *prefix;
diff --git a/src/parser_lyb.c b/src/parser_lyb.c
index a164e71..0bcad90 100644
--- a/src/parser_lyb.c
+++ b/src/parser_lyb.c
@@ -583,7 +583,7 @@
  */
 static LY_ERR
 lyb_parse_schema_hash(struct lyd_lyb_ctx *lybctx, const struct lysc_node *sparent, const struct lys_module *mod,
-                      const struct lysc_node **snode)
+        const struct lysc_node **snode)
 {
     LY_ERR ret;
     uint8_t i, j;
@@ -710,11 +710,11 @@
         LY_CHECK_GOTO(ret, cleanup);
     }
 
-     if (!snode && !(lybctx->parse_options & LYD_PARSE_OPAQ)) {
+    if (!snode && !(lybctx->parse_options & LYD_PARSE_OPAQ)) {
         /* unknown data, skip them */
         lyb_skip_subtree(lybctx->lybctx);
         goto stop_subtree;
-     }
+    }
 
     /* create metadata/attributes */
     if (snode) {
@@ -987,7 +987,7 @@
  */
 static LY_ERR
 lyd_parse_lyb_(const struct ly_ctx *ctx, struct lyd_node_inner **parent, struct ly_in *in, int parse_options, int validate_options,
-               int data_type, struct lyd_node **tree_p, struct lyd_node **op_p, struct lyd_ctx **lydctx_p)
+        int data_type, struct lyd_node **tree_p, struct lyd_node **op_p, struct lyd_ctx **lydctx_p)
 {
     LY_ERR ret = LY_SUCCESS;
     struct lyd_lyb_ctx *lybctx;
@@ -1084,7 +1084,7 @@
 
 LY_ERR
 lyd_parse_lyb_data(const struct ly_ctx *ctx, struct ly_in *in, int parse_options, int validate_options,
-                   struct lyd_node **tree_p, struct lyd_ctx **lydctx_p)
+        struct lyd_node **tree_p, struct lyd_ctx **lydctx_p)
 {
     return lyd_parse_lyb_(ctx, NULL, in, parse_options, validate_options, 0, tree_p, NULL, lydctx_p);
 }
diff --git a/src/parser_schema.h b/src/parser_schema.h
index 9e3985a..5001fe8 100644
--- a/src/parser_schema.h
+++ b/src/parser_schema.h
@@ -108,7 +108,7 @@
  * @return LY_ERR value (LY_SUCCESS is returned even if the file is not found, then the *localfile is NULL).
  */
 LY_ERR lys_search_localfile(const char * const *searchpaths, int cwd, const char *name, const char *revision,
-                            char **localfile, LYS_INFORMAT *format);
+        char **localfile, LYS_INFORMAT *format);
 
 /** @} schematree */
 
diff --git a/src/parser_stmt.c b/src/parser_stmt.c
index 5703ffe..7f282a6 100644
--- a/src/parser_stmt.c
+++ b/src/parser_stmt.c
@@ -73,7 +73,7 @@
  */
 static LY_ERR
 lysp_stmt_ext(struct lys_parser_ctx *ctx, const struct lysp_stmt *stmt, LYEXT_SUBSTMT insubstmt,
-              LY_ARRAY_COUNT_TYPE insubstmt_index, struct lysp_ext_instance **exts)
+        LY_ARRAY_COUNT_TYPE insubstmt_index, struct lysp_ext_instance **exts)
 {
     struct lysp_ext_instance *e;
 
@@ -109,7 +109,7 @@
  */
 static LY_ERR
 lysp_stmt_text_field(struct lys_parser_ctx *ctx, const struct lysp_stmt *stmt, LYEXT_SUBSTMT substmt, uint32_t substmt_index,
-                     const char **value, enum yang_arg arg, struct lysp_ext_instance **exts)
+        const char **value, enum yang_arg arg, struct lysp_ext_instance **exts)
 {
     const struct lysp_stmt *child;
 
@@ -153,7 +153,7 @@
  */
 static LY_ERR
 lysp_stmt_text_fields(struct lys_parser_ctx *ctx, const struct lysp_stmt *stmt, LYEXT_SUBSTMT substmt,
-                      const char ***texts, enum yang_arg arg, struct lysp_ext_instance **exts)
+        const char ***texts, enum yang_arg arg, struct lysp_ext_instance **exts)
 {
     const char **item;
     const struct lysp_stmt *child;
@@ -315,7 +315,7 @@
  */
 static LY_ERR
 lysp_stmt_type_enum_value_pos(struct lys_parser_ctx *ctx, const struct lysp_stmt *stmt, enum ly_stmt val_kw, int64_t *value, uint16_t *flags,
-                              struct lysp_ext_instance **exts)
+        struct lysp_ext_instance **exts)
 {
     size_t arg_len;
     char *ptr = NULL;
@@ -529,7 +529,7 @@
  */
 static LY_ERR
 lysp_stmt_type_reqinstance(struct lys_parser_ctx *ctx, const struct lysp_stmt *stmt, uint8_t *reqinst, uint16_t *flags,
-                           struct lysp_ext_instance **exts)
+        struct lysp_ext_instance **exts)
 {
     size_t arg_len;
     struct lysp_stmt *child;
@@ -811,7 +811,7 @@
         ret = lysp_stmt_type((struct lys_parser_ctx *)&pctx, stmt, type);
         (*result) = type;
         break;
-        }
+    }
     default:
         LOGINT(ctx->ctx);
         return LY_EINT;
diff --git a/src/parser_xml.c b/src/parser_xml.c
index 5a4fb80..a28e432 100644
--- a/src/parser_xml.c
+++ b/src/parser_xml.c
@@ -547,7 +547,7 @@
 
             /* add any missing default children */
             ret = lyd_new_implicit_r(node, lyd_node_children_p(node), NULL, NULL, &lydctx->unres_node_type, &lydctx->when_check,
-                                     (lydctx->validate_options & LYD_VALIDATE_NO_STATE) ? LYD_IMPLICIT_NO_STATE : 0, NULL);
+                            (lydctx->validate_options & LYD_VALIDATE_NO_STATE) ? LYD_IMPLICIT_NO_STATE : 0, NULL);
             LY_CHECK_GOTO(ret, error);
         }
 
@@ -617,7 +617,7 @@
 
 LY_ERR
 lyd_parse_xml_data(const struct ly_ctx *ctx, struct ly_in *in, int parse_options, int validate_options,
-                   struct lyd_node **tree_p, struct lyd_ctx **lydctx_p)
+        struct lyd_node **tree_p, struct lyd_ctx **lydctx_p)
 {
     LY_ERR ret = LY_SUCCESS;
     struct lyd_xml_ctx *lydctx;
@@ -641,7 +641,7 @@
 cleanup:
     /* there should be no unresolved types stored */
     assert(!(parse_options & LYD_PARSE_ONLY) || (!lydctx->unres_node_type.count && !lydctx->unres_meta_type.count
-           && !lydctx->when_check.count));
+            && !lydctx->when_check.count));
 
     if (ret) {
         lyd_xml_ctx_free((struct lyd_ctx *)lydctx);
diff --git a/src/parser_yang.c b/src/parser_yang.c
index 0c50d57..3a0b339 100644
--- a/src/parser_yang.c
+++ b/src/parser_yang.c
@@ -79,7 +79,7 @@
             ERR = get_keyword(CTX, IN, &KW, &WORD, &WORD_LEN))
 
 LY_ERR parse_container(struct lys_yang_parser_ctx *ctx, struct ly_in *in, struct lysp_node *parent,
-                       struct lysp_node **siblings);
+        struct lysp_node **siblings);
 LY_ERR parse_uses(struct lys_yang_parser_ctx *ctx, struct ly_in *in, struct lysp_node *parent, struct lysp_node **siblings);
 LY_ERR parse_choice(struct lys_yang_parser_ctx *ctx, struct ly_in *in, struct lysp_node *parent, struct lysp_node **siblings);
 LY_ERR parse_case(struct lys_yang_parser_ctx *ctx, struct ly_in *in, struct lysp_node *parent, struct lysp_node **siblings);
@@ -139,7 +139,7 @@
  */
 LY_ERR
 buf_store_char(struct lys_yang_parser_ctx *ctx, struct ly_in *in, enum yang_arg arg, char **word_p, size_t *word_len,
-               char **word_b, size_t *buf_len, int need_buf, int *prefix)
+        char **word_b, size_t *buf_len, int need_buf, int *prefix)
 {
     unsigned int c;
     size_t len;
@@ -290,7 +290,7 @@
  */
 static LY_ERR
 read_qstring(struct lys_yang_parser_ctx *ctx, struct ly_in *in, enum yang_arg arg, char **word_p, char **word_b,
-             size_t *word_len, size_t *buf_len)
+        size_t *word_len, size_t *buf_len)
 {
     /* string: 0 - string ended, 1 - string with ', 2 - string with ", 3 - string with " with last character \,
      *         4 - string finished, now skipping whitespaces looking for +,
@@ -448,7 +448,7 @@
                 break;
             case '\n':
                 ++ctx->line;
-                /* fallthrough */
+            /* fallthrough */
             case ' ':
             case '\t':
                 /* just skip */
@@ -463,7 +463,7 @@
             switch (in->current[0]) {
             case '\n':
                 ++ctx->line;
-                /* fallthrough */
+            /* fallthrough */
             case ' ':
             case '\t':
                 /* skip */
@@ -511,7 +511,7 @@
  */
 LY_ERR
 get_argument(struct lys_yang_parser_ctx *ctx, struct ly_in *in, enum yang_arg arg, uint16_t *flags, char **word_p,
-             char **word_b, size_t *word_len)
+        char **word_b, size_t *word_len)
 {
     size_t buf_len = 0;
     int prefix = 0;
@@ -708,7 +708,7 @@
             if (*kw == LY_STMT_INPUT || *kw == LY_STMT_OUTPUT) {
                 break;
             }
-            /* fallthrough */
+        /* fallthrough */
         default:
             MOVE_INPUT(ctx, in, 1);
             LOGVAL_PARSER(ctx, LY_VCODE_INSTREXP, (int)(in->current - word_start), word_start,
@@ -764,7 +764,7 @@
  */
 static LY_ERR
 parse_ext_substmt(struct lys_yang_parser_ctx *ctx, struct ly_in *in, enum ly_stmt kw, char *word, size_t word_len,
-                  struct lysp_stmt **child)
+        struct lysp_stmt **child)
 {
     char *buf;
     LY_ERR ret = LY_SUCCESS;
@@ -817,7 +817,7 @@
  */
 static LY_ERR
 parse_ext(struct lys_yang_parser_ctx *ctx, struct ly_in *in, const char *ext_name, int ext_name_len, LYEXT_SUBSTMT insubstmt,
-          LY_ARRAY_COUNT_TYPE insubstmt_index, struct lysp_ext_instance **exts)
+        LY_ARRAY_COUNT_TYPE insubstmt_index, struct lysp_ext_instance **exts)
 {
     LY_ERR ret = LY_SUCCESS;
     char *buf, *word;
@@ -861,7 +861,7 @@
  */
 static LY_ERR
 parse_text_field(struct lys_yang_parser_ctx *ctx, struct ly_in *in, LYEXT_SUBSTMT substmt, uint32_t substmt_index,
-                 const char **value, enum yang_arg arg, struct lysp_ext_instance **exts)
+        const char **value, enum yang_arg arg, struct lysp_ext_instance **exts)
 {
     LY_ERR ret = LY_SUCCESS;
     char *buf, *word;
@@ -1223,7 +1223,7 @@
  */
 static LY_ERR
 parse_text_fields(struct lys_yang_parser_ctx *ctx, struct ly_in *in, LYEXT_SUBSTMT substmt, const char ***texts, enum yang_arg arg,
-                  struct lysp_ext_instance **exts)
+        struct lysp_ext_instance **exts)
 {
     LY_ERR ret = LY_SUCCESS;
     char *buf, *word;
@@ -1582,7 +1582,7 @@
             break;
         default:
             LOGVAL_PARSER(ctx, LY_VCODE_INCHILDSTMT, ly_stmt2str(kw),
-                   (any->nodetype & LYS_ANYDATA) == LYS_ANYDATA ? ly_stmt2str(LY_STMT_ANYDATA) : ly_stmt2str(LY_STMT_ANYXML));
+                    (any->nodetype & LYS_ANYDATA) == LYS_ANYDATA ? ly_stmt2str(LY_STMT_ANYDATA) : ly_stmt2str(LY_STMT_ANYXML));
             return LY_EVALID;
         }
     }
@@ -1603,7 +1603,7 @@
  */
 LY_ERR
 parse_type_enum_value_pos(struct lys_yang_parser_ctx *ctx, struct ly_in *in, enum ly_stmt val_kw, int64_t *value, uint16_t *flags,
-                          struct lysp_ext_instance **exts)
+        struct lysp_ext_instance **exts)
 {
     LY_ERR ret = LY_SUCCESS;
     char *buf, *word, *ptr;
@@ -1815,7 +1815,7 @@
  */
 static LY_ERR
 parse_type_reqinstance(struct lys_yang_parser_ctx *ctx, struct ly_in *in, uint8_t *reqinst, uint16_t *flags,
-                       struct lysp_ext_instance **exts)
+        struct lysp_ext_instance **exts)
 {
     LY_ERR ret = LY_SUCCESS;
     char *buf, *word;
@@ -1865,7 +1865,7 @@
  */
 static LY_ERR
 parse_type_pattern_modifier(struct lys_yang_parser_ctx *ctx, struct ly_in *in, const char **pat,
-                            struct lysp_ext_instance **exts)
+        struct lysp_ext_instance **exts)
 {
     LY_ERR ret = LY_SUCCESS;
     char *buf, *word;
@@ -2179,7 +2179,7 @@
  */
 LY_ERR
 parse_maxelements(struct lys_yang_parser_ctx *ctx, struct ly_in *in, uint32_t *max, uint16_t *flags,
-                  struct lysp_ext_instance **exts)
+        struct lysp_ext_instance **exts)
 {
     LY_ERR ret = LY_SUCCESS;
     char *buf, *word, *ptr;
@@ -2247,7 +2247,7 @@
  */
 LY_ERR
 parse_minelements(struct lys_yang_parser_ctx *ctx, struct ly_in *in, uint32_t *min, uint16_t *flags,
-                  struct lysp_ext_instance **exts)
+        struct lysp_ext_instance **exts)
 {
     LY_ERR ret = LY_SUCCESS;
     char *buf, *word, *ptr;
@@ -2618,7 +2618,7 @@
         switch (kw) {
         case LY_STMT_ANYDATA:
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", ly_stmt2str(inout_kw));
-            /* fall through */
+        /* fall through */
         case LY_STMT_ANYXML:
             LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)inout_p, &inout_p->data));
             break;
@@ -2785,7 +2785,7 @@
 
         case LY_STMT_ANYDATA:
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "notification");
-            /* fall through */
+        /* fall through */
         case LY_STMT_ANYXML:
             LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)notif, &notif->data));
             break;
@@ -2874,7 +2874,7 @@
 
         case LY_STMT_ANYDATA:
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "grouping");
-            /* fall through */
+        /* fall through */
         case LY_STMT_ANYXML:
             LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)grp, &grp->data));
             break;
@@ -2974,7 +2974,7 @@
 
         case LY_STMT_ANYDATA:
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "augment");
-            /* fall through */
+        /* fall through */
         case LY_STMT_ANYXML:
             LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)aug, &aug->child));
             break;
@@ -3139,7 +3139,7 @@
 
         case LY_STMT_ANYDATA:
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "case");
-            /* fall through */
+        /* fall through */
         case LY_STMT_ANYXML:
             LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)cas, &cas->child));
             break;
@@ -3229,7 +3229,7 @@
 
         case LY_STMT_ANYDATA:
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "choice");
-            /* fall through */
+        /* fall through */
         case LY_STMT_ANYXML:
             LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)choice, &choice->child));
             break;
@@ -3323,7 +3323,7 @@
 
         case LY_STMT_ANYDATA:
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "container");
-            /* fall through */
+        /* fall through */
         case LY_STMT_ANYXML:
             LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)cont, &cont->child));
             break;
@@ -3443,7 +3443,7 @@
 
         case LY_STMT_ANYDATA:
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "list");
-            /* fall through */
+        /* fall through */
         case LY_STMT_ANYXML:
             LY_CHECK_RET(parse_any(ctx, in, kw, (struct lysp_node*)list, &list->child));
             break;
@@ -4143,7 +4143,7 @@
         /* body */
         case LY_STMT_ANYDATA:
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "module");
-            /* fall through */
+        /* fall through */
         case LY_STMT_ANYXML:
             LY_CHECK_RET(parse_any(ctx, in, kw, NULL, &mod->data));
             break;
@@ -4349,7 +4349,7 @@
         /* body */
         case LY_STMT_ANYDATA:
             PARSER_CHECK_STMTVER2_RET(ctx, "anydata", "submodule");
-            /* fall through */
+        /* fall through */
         case LY_STMT_ANYXML:
             LY_CHECK_RET(parse_any(ctx, in, kw, NULL, &submod->data));
             break;
@@ -4434,7 +4434,7 @@
 
 LY_ERR
 yang_parse_submodule(struct lys_yang_parser_ctx **context, struct ly_ctx *ly_ctx, struct lys_parser_ctx *main_ctx,
-                     struct ly_in *in, struct lysp_submodule **submod)
+        struct ly_in *in, struct lysp_submodule **submod)
 {
     LY_ERR ret = LY_SUCCESS;
     char *word;
diff --git a/src/parser_yin.c b/src/parser_yin.c
index 77a3336..2e549a7 100644
--- a/src/parser_yin.c
+++ b/src/parser_yin.c
@@ -58,7 +58,7 @@
 
 enum ly_stmt
 yin_match_keyword(struct lys_yin_parser_ctx *ctx, const char *name, size_t name_len,
-                  const char *prefix, size_t prefix_len, enum ly_stmt parent)
+        const char *prefix, size_t prefix_len, enum ly_stmt parent)
 {
     const char *start = NULL;
     enum ly_stmt kw = LY_STMT_NONE;
@@ -217,7 +217,7 @@
  */
 static LY_ERR
 subelems_allocator(struct lys_yin_parser_ctx *ctx, size_t count, struct lysp_node *parent,
-                   struct yin_subelement **result, ...)
+        struct yin_subelement **result, ...)
 {
     va_list ap;
 
@@ -321,7 +321,7 @@
  */
 static LY_ERR
 yin_parse_attribute(struct lys_yin_parser_ctx *ctx, enum yin_argument arg_type, const char **arg_val, enum yang_arg val_type,
-                    enum ly_stmt current_element)
+        enum ly_stmt current_element)
 {
     enum yin_argument arg = YIN_ARG_UNKNOWN;
     bool found = false;
@@ -400,7 +400,7 @@
  */
 static LY_ERR
 yin_check_subelem_mandatory_constraint(struct lys_yin_parser_ctx *ctx, struct yin_subelement *subelem_info,
-                                       signed char subelem_info_size, enum ly_stmt current_element)
+        signed char subelem_info_size, enum ly_stmt current_element)
 {
     for (signed char i = 0; i < subelem_info_size; ++i) {
         /* if there is element that is mandatory and isn't parsed log error and return LY_EVALID */
@@ -427,8 +427,8 @@
  */
 static LY_ERR
 yin_check_subelem_first_constraint(struct lys_yin_parser_ctx *ctx, struct yin_subelement *subelem_info,
-                                   signed char subelem_info_size, enum ly_stmt current_element,
-                                   struct yin_subelement *exp_first)
+        signed char subelem_info_size, enum ly_stmt current_element,
+        struct yin_subelement *exp_first)
 {
     for (signed char i = 0; i < subelem_info_size; ++i) {
         if (subelem_info[i].flags & YIN_SUBELEM_PARSED) {
@@ -455,13 +455,13 @@
  */
 static LY_ERR
 yin_parse_simple_element(struct lys_yin_parser_ctx *ctx, enum ly_stmt kw, const char **value,
-                         enum yin_argument arg_type, enum yang_arg arg_val_type, struct lysp_ext_instance **exts)
+        enum yin_argument arg_type, enum yang_arg arg_val_type, struct lysp_ext_instance **exts)
 {
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
     LY_CHECK_RET(yin_parse_attribute(ctx, arg_type, value, arg_val_type, kw));
     struct yin_subelement subelems[1] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
 
     return yin_parse_content(ctx, subelems, 1, kw, NULL, exts);
 }
@@ -520,13 +520,13 @@
     type->flags |= LYS_SET_PATTERN;
 
     struct yin_subelement subelems[6] = {
-                                            {LY_STMT_DESCRIPTION, &restr->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_ERROR_APP_TAG, &restr->eapptag, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_ERROR_MESSAGE, &restr->emsg, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_MODIFIER, &restr->arg, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_REFERENCE, &restr->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_DESCRIPTION, &restr->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_ERROR_APP_TAG, &restr->eapptag, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_ERROR_MESSAGE, &restr->emsg, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_MODIFIER, &restr->arg, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_REFERENCE, &restr->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
     return yin_parse_content(ctx, subelems, 6, LY_STMT_PATTERN, NULL, &restr->exts);
 }
 
@@ -569,8 +569,8 @@
     type->fraction_digits = num;
     type->flags |= LYS_SET_FRDIGITS;
     struct yin_subelement subelems[1] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
     return yin_parse_content(ctx, subelems, 1, LY_STMT_FRACTION_DIGITS, NULL, &type->exts);
 }
 
@@ -595,13 +595,13 @@
     CHECK_UNIQUENESS((struct lys_parser_ctx *)ctx, type->enums, name, "enum", en->name);
 
     struct yin_subelement subelems[6] = {
-                                            {LY_STMT_DESCRIPTION, &en->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_IF_FEATURE, &en->iffeatures, 0},
-                                            {LY_STMT_REFERENCE, &en->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_STATUS, &en->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_VALUE, en, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_DESCRIPTION, &en->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_IF_FEATURE, &en->iffeatures, 0},
+        {LY_STMT_REFERENCE, &en->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_STATUS, &en->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_VALUE, en, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
     return yin_parse_content(ctx, subelems, 6, LY_STMT_ENUM, NULL, &en->exts);
 }
 
@@ -624,13 +624,13 @@
     CHECK_UNIQUENESS((struct lys_parser_ctx *)ctx, type->enums, name, "bit", en->name);
 
     struct yin_subelement subelems[6] = {
-                                            {LY_STMT_DESCRIPTION, &en->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_IF_FEATURE, &en->iffeatures, 0},
-                                            {LY_STMT_POSITION, en, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_REFERENCE, &en->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_STATUS, &en->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_DESCRIPTION, &en->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_IF_FEATURE, &en->iffeatures, 0},
+        {LY_STMT_POSITION, en, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_REFERENCE, &en->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_STATUS, &en->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
     return yin_parse_content(ctx, subelems, 6, LY_STMT_BIT, NULL, &en->exts);
 }
 
@@ -648,14 +648,14 @@
  */
 static LY_ERR
 yin_parse_simple_elements(struct lys_yin_parser_ctx *ctx, enum ly_stmt kw, const char ***values, enum yin_argument arg_type,
-                          enum yang_arg arg_val_type, struct lysp_ext_instance **exts)
+        enum yang_arg arg_val_type, struct lysp_ext_instance **exts)
 {
     const char **value;
     LY_ARRAY_NEW_RET(ctx->xmlctx->ctx, *values, value, LY_EMEM);
     LY_ARRAY_COUNT_TYPE index = LY_ARRAY_COUNT(*values) - 1;
     struct yin_subelement subelems[1] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, &index, 0}
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, &index, 0}
+    };
 
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
     LY_CHECK_RET(yin_parse_attribute(ctx, arg_type, value, arg_val_type, kw));
@@ -676,7 +676,7 @@
  */
 static LY_ERR
 yin_parse_simple_elem(struct lys_yin_parser_ctx *ctx, enum ly_stmt kw, struct yin_subelement *subinfo,
-                      enum yin_argument arg_type, enum yang_arg arg_val_type, struct lysp_ext_instance **exts)
+        enum yin_argument arg_type, enum yang_arg arg_val_type, struct lysp_ext_instance **exts)
 {
     if (subinfo->flags & YIN_SUBELEM_UNIQUE) {
         LY_CHECK_RET(yin_parse_simple_element(ctx, kw, (const char **)subinfo->dest,
@@ -731,8 +731,8 @@
 {
     const char *temp_val = NULL;
     struct yin_subelement subelems[1] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
 
     type->flags |= LYS_SET_REQINST;
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
@@ -766,8 +766,8 @@
     const char *temp_val;
     char *modified_val;
     struct yin_subelement subelems[1] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
 
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
     LY_CHECK_RET(yin_parse_attribute(ctx, YIN_ARG_VALUE, &temp_val, Y_STR_ARG, LY_STMT_MODIFIER));
@@ -804,12 +804,12 @@
 {
     assert(restr_kw == LY_STMT_MUST || restr_kw == LY_STMT_LENGTH || restr_kw == LY_STMT_RANGE);
     struct yin_subelement subelems[5] = {
-                                            {LY_STMT_DESCRIPTION, &restr->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_ERROR_APP_TAG, &restr->eapptag, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_ERROR_MESSAGE, &restr->emsg, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_REFERENCE, &restr->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_DESCRIPTION, &restr->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_ERROR_APP_TAG, &restr->eapptag, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_ERROR_MESSAGE, &restr->emsg, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_REFERENCE, &restr->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
     /* argument of must is called condition, but argument of length and range is called value */
     enum yin_argument arg_type = (restr_kw == LY_STMT_MUST) ? YIN_ARG_CONDITION : YIN_ARG_VALUE;
 
@@ -899,7 +899,7 @@
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
     LY_CHECK_RET(yin_parse_attribute(ctx, YIN_ARG_VALUE, &temp_val, Y_STR_ARG, kw));
     if (!temp_val || temp_val[0] == '\0' || (temp_val[0] == '+') ||
-        ((temp_val[0] == '0') && (temp_val[1] != '\0')) || ((kw == LY_STMT_POSITION) && !strcmp(temp_val, "-0"))) {
+            ((temp_val[0] == '0') && (temp_val[1] != '\0')) || ((kw == LY_STMT_POSITION) && !strcmp(temp_val, "-0"))) {
         LOGVAL_PARSER((struct lys_parser_ctx *)ctx, LY_VCODE_INVAL_YIN, temp_val, "value", ly_stmt2str(kw));
         goto error;
     }
@@ -938,8 +938,8 @@
 
     /* parse subelements */
     struct yin_subelement subelems[1] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
     return yin_parse_content(ctx, subelems, 1, kw, NULL, &enm->exts);
 
 error:
@@ -960,9 +960,9 @@
 yin_parse_belongs_to(struct lys_yin_parser_ctx *ctx, struct lysp_submodule *submod, struct lysp_ext_instance **exts)
 {
     struct yin_subelement subelems[2] = {
-                                            {LY_STMT_PREFIX, &submod->prefix, YIN_SUBELEM_MANDATORY | YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_PREFIX, &submod->prefix, YIN_SUBELEM_MANDATORY | YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
 
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
     LY_CHECK_RET(yin_parse_attribute(ctx, YIN_ARG_MODULE, &submod->belongsto, Y_IDENTIF_ARG, LY_STMT_BELONGS_TO));
@@ -987,9 +987,9 @@
     assert(elem_type == LY_STMT_ORGANIZATION || elem_type == LY_STMT_CONTACT || elem_type == LY_STMT_DESCRIPTION || elem_type == LY_STMT_REFERENCE);
 
     struct yin_subelement subelems[2] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                            {LY_STMT_ARG_TEXT, value, YIN_SUBELEM_MANDATORY | YIN_SUBELEM_UNIQUE | YIN_SUBELEM_FIRST}
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+        {LY_STMT_ARG_TEXT, value, YIN_SUBELEM_MANDATORY | YIN_SUBELEM_UNIQUE | YIN_SUBELEM_FIRST}
+    };
     /* check attributes */
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
     LY_CHECK_RET(yin_parse_attribute(ctx, YIN_ARG_NONE, NULL, Y_MAYBE_STR_ARG, elem_type));
@@ -1011,9 +1011,9 @@
 yin_parse_err_msg(struct lys_yin_parser_ctx *ctx, const char **value, struct lysp_ext_instance **exts)
 {
     struct yin_subelement subelems[2] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                            {LY_STMT_ARG_VALUE, value, YIN_SUBELEM_MANDATORY | YIN_SUBELEM_UNIQUE | YIN_SUBELEM_FIRST}
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+        {LY_STMT_ARG_VALUE, value, YIN_SUBELEM_MANDATORY | YIN_SUBELEM_UNIQUE | YIN_SUBELEM_FIRST}
+    };
 
     /* check attributes */
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
@@ -1050,18 +1050,18 @@
         type = nested_type;
     }
     struct yin_subelement subelems[11] = {
-                                            {LY_STMT_BASE, type, 0},
-                                            {LY_STMT_BIT, type, 0},
-                                            {LY_STMT_ENUM, type, 0},
-                                            {LY_STMT_FRACTION_DIGITS, type, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_LENGTH, type, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_PATH, type, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_PATTERN, type, 0},
-                                            {LY_STMT_RANGE, type, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_REQUIRE_INSTANCE, type, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_TYPE, type},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                        };
+        {LY_STMT_BASE, type, 0},
+        {LY_STMT_BIT, type, 0},
+        {LY_STMT_ENUM, type, 0},
+        {LY_STMT_FRACTION_DIGITS, type, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_LENGTH, type, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_PATH, type, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_PATTERN, type, 0},
+        {LY_STMT_RANGE, type, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_REQUIRE_INSTANCE, type, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_TYPE, type},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+    };
 
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
     LY_CHECK_RET(yin_parse_attribute(ctx, YIN_ARG_NAME, &type->name, Y_PREF_IDENTIF_ARG, LY_STMT_TYPE));
@@ -1085,8 +1085,8 @@
     char *ptr;
     unsigned long int num;
     struct yin_subelement subelems[1] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+    };
 
     *flags |= LYS_SET_MAX;
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
@@ -1133,8 +1133,8 @@
     char *ptr;
     unsigned long int num;
     struct yin_subelement subelems[1] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+    };
 
     *flags |= LYS_SET_MIN;
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
@@ -1223,8 +1223,8 @@
 {
     const char *temp_val;
     struct yin_subelement subelems[1] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+    };
 
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
     LY_CHECK_RET(yin_parse_attribute(ctx, YIN_ARG_VALUE, &temp_val, Y_STR_ARG, LY_STMT_ORDERED_BY));
@@ -1267,16 +1267,16 @@
     LY_CHECK_RET(yin_parse_attribute(ctx, YIN_ARG_NAME, &any->name, Y_IDENTIF_ARG, any_kw));
 
     struct yin_subelement subelems[9] = {
-                                            {LY_STMT_CONFIG, &any->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_DESCRIPTION, &any->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_IF_FEATURE, &any->iffeatures, 0},
-                                            {LY_STMT_MANDATORY, &any->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_MUST, &any->musts, 0},
-                                            {LY_STMT_REFERENCE, &any->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_STATUS, &any->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_WHEN, &any->when, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                        };
+        {LY_STMT_CONFIG, &any->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_DESCRIPTION, &any->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_IF_FEATURE, &any->iffeatures, 0},
+        {LY_STMT_MANDATORY, &any->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_MUST, &any->musts, 0},
+        {LY_STMT_REFERENCE, &any->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_STATUS, &any->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_WHEN, &any->when, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+    };
     return yin_parse_content(ctx, subelems, 9, any_kw, NULL, &any->exts);
 }
 
@@ -1304,19 +1304,19 @@
 
     /* parse content */
     struct yin_subelement subelems[12] = {
-                                            {LY_STMT_CONFIG, &leaf->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_DEFAULT, &leaf->dflt, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_DESCRIPTION, &leaf->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_IF_FEATURE, &leaf->iffeatures, 0},
-                                            {LY_STMT_MANDATORY, &leaf->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_MUST, &leaf->musts, 0},
-                                            {LY_STMT_REFERENCE, &leaf->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_STATUS, &leaf->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_TYPE, &leaf->type, YIN_SUBELEM_UNIQUE | YIN_SUBELEM_MANDATORY},
-                                            {LY_STMT_UNITS, &leaf->units, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_WHEN, &leaf->when, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                         };
+        {LY_STMT_CONFIG, &leaf->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_DEFAULT, &leaf->dflt, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_DESCRIPTION, &leaf->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_IF_FEATURE, &leaf->iffeatures, 0},
+        {LY_STMT_MANDATORY, &leaf->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_MUST, &leaf->musts, 0},
+        {LY_STMT_REFERENCE, &leaf->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_STATUS, &leaf->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_TYPE, &leaf->type, YIN_SUBELEM_UNIQUE | YIN_SUBELEM_MANDATORY},
+        {LY_STMT_UNITS, &leaf->units, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_WHEN, &leaf->when, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+    };
     return yin_parse_content(ctx, subelems, 12, LY_STMT_LEAF, NULL, &leaf->exts);
 }
 
@@ -1344,21 +1344,21 @@
 
     /* parse content */
     struct yin_subelement subelems[14] = {
-                                            {LY_STMT_CONFIG, &llist->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_DEFAULT, &llist->dflts, 0},
-                                            {LY_STMT_DESCRIPTION, &llist->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_IF_FEATURE, &llist->iffeatures, 0},
-                                            {LY_STMT_MAX_ELEMENTS, llist, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_MIN_ELEMENTS, llist, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_MUST, &llist->musts, 0},
-                                            {LY_STMT_ORDERED_BY, &llist->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_REFERENCE, &llist->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_STATUS, &llist->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_TYPE, &llist->type, YIN_SUBELEM_UNIQUE | YIN_SUBELEM_MANDATORY},
-                                            {LY_STMT_UNITS, &llist->units, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_WHEN, &llist->when, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                        };
+        {LY_STMT_CONFIG, &llist->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_DEFAULT, &llist->dflts, 0},
+        {LY_STMT_DESCRIPTION, &llist->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_IF_FEATURE, &llist->iffeatures, 0},
+        {LY_STMT_MAX_ELEMENTS, llist, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_MIN_ELEMENTS, llist, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_MUST, &llist->musts, 0},
+        {LY_STMT_ORDERED_BY, &llist->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_REFERENCE, &llist->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_STATUS, &llist->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_TYPE, &llist->type, YIN_SUBELEM_UNIQUE | YIN_SUBELEM_MANDATORY},
+        {LY_STMT_UNITS, &llist->units, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_WHEN, &llist->when, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+    };
     LY_CHECK_RET(yin_parse_content(ctx, subelems, 14, LY_STMT_LEAF_LIST, NULL, &llist->exts));
 
     /* check invalid combination of subelements */
@@ -1395,14 +1395,14 @@
 
     /* parse content */
     struct yin_subelement subelems[7] = {
-                                            {LY_STMT_DEFAULT, &tpdf->dflt, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_DESCRIPTION, &tpdf->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_REFERENCE, &tpdf->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_STATUS, &tpdf->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_TYPE, &tpdf->type, YIN_SUBELEM_UNIQUE | YIN_SUBELEM_MANDATORY},
-                                            {LY_STMT_UNITS, &tpdf->units, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                        };
+        {LY_STMT_DEFAULT, &tpdf->dflt, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_DESCRIPTION, &tpdf->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_REFERENCE, &tpdf->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_STATUS, &tpdf->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_TYPE, &tpdf->type, YIN_SUBELEM_UNIQUE | YIN_SUBELEM_MANDATORY},
+        {LY_STMT_UNITS, &tpdf->units, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+    };
     LY_CHECK_RET(yin_parse_content(ctx, subelems, 7, LY_STMT_TYPEDEF, NULL, &tpdf->exts));
 
     /* store data for collision check */
@@ -1436,18 +1436,18 @@
 
     /* parse content */
     struct yin_subelement subelems[11] = {
-                                            {LY_STMT_CONFIG, &rf->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_DEFAULT, &rf->dflts, 0},
-                                            {LY_STMT_DESCRIPTION, &rf->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_IF_FEATURE, &rf->iffeatures, 0},
-                                            {LY_STMT_MANDATORY, &rf->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_MAX_ELEMENTS, rf, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_MIN_ELEMENTS, rf, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_MUST, &rf->musts, 0},
-                                            {LY_STMT_PRESENCE, &rf->presence, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_REFERENCE, &rf->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                        };
+        {LY_STMT_CONFIG, &rf->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_DEFAULT, &rf->dflts, 0},
+        {LY_STMT_DESCRIPTION, &rf->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_IF_FEATURE, &rf->iffeatures, 0},
+        {LY_STMT_MANDATORY, &rf->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_MAX_ELEMENTS, rf, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_MIN_ELEMENTS, rf, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_MUST, &rf->musts, 0},
+        {LY_STMT_PRESENCE, &rf->presence, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_REFERENCE, &rf->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+    };
     return yin_parse_content(ctx, subelems, 11, LY_STMT_REFINE, NULL, &rf->exts);
 }
 
@@ -1476,15 +1476,15 @@
     /* parse content */
     struct tree_node_meta augments = {(struct lysp_node *)uses, (struct lysp_node **)&uses->augments};
     struct yin_subelement subelems[8] = {
-                                            {LY_STMT_AUGMENT, &augments, 0},
-                                            {LY_STMT_DESCRIPTION, &uses->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_IF_FEATURE, &uses->iffeatures, 0},
-                                            {LY_STMT_REFERENCE, &uses->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_REFINE, &uses->refines, 0},
-                                            {LY_STMT_STATUS, &uses->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_WHEN, &uses->when, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                        };
+        {LY_STMT_AUGMENT, &augments, 0},
+        {LY_STMT_DESCRIPTION, &uses->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_IF_FEATURE, &uses->iffeatures, 0},
+        {LY_STMT_REFERENCE, &uses->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_REFINE, &uses->refines, 0},
+        {LY_STMT_STATUS, &uses->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_WHEN, &uses->when, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+    };
     LY_CHECK_RET(yin_parse_content(ctx, subelems, 8, LY_STMT_USES, NULL, &uses->exts));
     LY_CHECK_RET(lysp_parse_finalize_reallocated((struct lys_parser_ctx *)ctx, NULL, uses->augments, NULL, NULL));
 
@@ -1521,10 +1521,10 @@
 
     /* parse content */
     struct yin_subelement subelems[3] = {
-                                            {LY_STMT_DESCRIPTION, &rev->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_REFERENCE, &rev->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                        };
+        {LY_STMT_DESCRIPTION, &rev->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_REFERENCE, &rev->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+    };
     return yin_parse_content(ctx, subelems, 3, LY_STMT_REVISION, NULL, &rev->exts);
 }
 
@@ -1557,11 +1557,11 @@
 
     /* parse content */
     struct yin_subelement subelems[4] = {
-                                            {LY_STMT_DESCRIPTION, &inc->dsc, YIN_SUBELEM_UNIQUE | YIN_SUBELEM_VER2},
-                                            {LY_STMT_REFERENCE, &inc->ref, YIN_SUBELEM_UNIQUE | YIN_SUBELEM_VER2},
-                                            {LY_STMT_REVISION_DATE, &inc->rev, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                        };
+        {LY_STMT_DESCRIPTION, &inc->dsc, YIN_SUBELEM_UNIQUE | YIN_SUBELEM_VER2},
+        {LY_STMT_REFERENCE, &inc->ref, YIN_SUBELEM_UNIQUE | YIN_SUBELEM_VER2},
+        {LY_STMT_REVISION_DATE, &inc->rev, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+    };
     return yin_parse_content(ctx, subelems, 4, LY_STMT_INCLUDE, NULL, &inc->exts);
 }
 
@@ -1579,8 +1579,8 @@
 {
     const char *temp_rev;
     struct yin_subelement subelems[1] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
 
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
     LY_CHECK_RET(yin_parse_attribute(ctx, YIN_ARG_DATE, &temp_rev, Y_STR_ARG, LY_STMT_REVISION_DATE));
@@ -1607,8 +1607,8 @@
 {
     const char *temp_val = NULL;
     struct yin_subelement subelems[1] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
 
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
     LY_CHECK_RET(yin_parse_attribute(ctx, YIN_ARG_VALUE, &temp_val, Y_STR_ARG, LY_STMT_CONFIG));
@@ -1641,8 +1641,8 @@
 {
     const char *temp_version = NULL;
     struct yin_subelement subelems[1] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
 
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
     LY_CHECK_RET(yin_parse_attribute(ctx, YIN_ARG_VALUE, &temp_version, Y_STR_ARG, LY_STMT_YANG_VERSION));
@@ -1678,12 +1678,12 @@
     LY_ARRAY_NEW_RET(ctx->xmlctx->ctx, *imp_meta->imports, imp, LY_EMEM);
 
     struct yin_subelement subelems[5] = {
-                                            {LY_STMT_DESCRIPTION, &imp->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_PREFIX, &imp->prefix, YIN_SUBELEM_MANDATORY | YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_REFERENCE, &imp->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_REVISION_DATE, imp->rev, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_DESCRIPTION, &imp->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_PREFIX, &imp->prefix, YIN_SUBELEM_MANDATORY | YIN_SUBELEM_UNIQUE},
+        {LY_STMT_REFERENCE, &imp->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_REVISION_DATE, imp->rev, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
 
     /* parse import attributes */
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
@@ -1709,8 +1709,8 @@
 {
     const char *temp_val = NULL;
     struct yin_subelement subelems[1] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
 
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
     LY_CHECK_RET(yin_parse_attribute(ctx, YIN_ARG_VALUE, &temp_val, Y_STR_ARG, LY_STMT_MANDATORY));
@@ -1743,8 +1743,8 @@
 {
     const char *value = NULL;
     struct yin_subelement subelems[1] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
 
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
     LY_CHECK_RET(yin_parse_attribute(ctx, YIN_ARG_VALUE, &value, Y_STR_ARG, LY_STMT_STATUS));
@@ -1788,10 +1788,10 @@
 
     *when_p = when;
     struct yin_subelement subelems[3] = {
-                                            {LY_STMT_DESCRIPTION, &when->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_REFERENCE, &when->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_DESCRIPTION, &when->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_REFERENCE, &when->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
 
     return yin_parse_content(ctx, subelems, 3, LY_STMT_WHEN, NULL, &when->exts);
 }
@@ -1811,8 +1811,8 @@
 {
     const char *temp_val = NULL;
     struct yin_subelement subelems[1] = {
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
 
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
     LY_CHECK_RET(yin_parse_attribute(ctx, YIN_ARG_VALUE, &temp_val, Y_STR_ARG, LY_STMT_YIN_ELEMENT));
@@ -1844,9 +1844,9 @@
 yin_parse_argument(struct lys_yin_parser_ctx *ctx, struct yin_argument_meta *arg_meta, struct lysp_ext_instance **exts)
 {
     struct yin_subelement subelems[2] = {
-                                            {LY_STMT_YIN_ELEMENT, arg_meta->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_YIN_ELEMENT, arg_meta->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
 
     LY_CHECK_RET(lyxml_ctx_next(ctx->xmlctx));
     LY_CHECK_RET(yin_parse_attribute(ctx, YIN_ARG_NAME, arg_meta->argument, Y_IDENTIF_ARG, LY_STMT_ARGUMENT));
@@ -1872,12 +1872,12 @@
 
     struct yin_argument_meta arg_info = {&ex->flags, &ex->argument};
     struct yin_subelement subelems[5] = {
-                                            {LY_STMT_ARGUMENT, &arg_info, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_DESCRIPTION, &ex->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_REFERENCE, &ex->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_STATUS, &ex->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                        };
+        {LY_STMT_ARGUMENT, &arg_info, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_DESCRIPTION, &ex->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_REFERENCE, &ex->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_STATUS, &ex->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+    };
 
     return yin_parse_content(ctx, subelems, 5, LY_STMT_EXTENSION, NULL, &ex->exts);
 }
@@ -1904,12 +1904,12 @@
 
     /* parse content */
     struct yin_subelement subelems[5] = {
-                                            {LY_STMT_DESCRIPTION, &feat->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_IF_FEATURE, &feat->iffeatures, 0},
-                                            {LY_STMT_REFERENCE, &feat->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_STATUS, &feat->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                        };
+        {LY_STMT_DESCRIPTION, &feat->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_IF_FEATURE, &feat->iffeatures, 0},
+        {LY_STMT_REFERENCE, &feat->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_STATUS, &feat->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+    };
     return yin_parse_content(ctx, subelems, 5, LY_STMT_FEATURE, NULL, &feat->exts);
 }
 
@@ -1935,13 +1935,13 @@
 
     /* parse content */
     struct yin_subelement subelems[6] = {
-                                            {LY_STMT_BASE, &ident->bases, 0},
-                                            {LY_STMT_DESCRIPTION, &ident->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_IF_FEATURE, &ident->iffeatures, YIN_SUBELEM_VER2},
-                                            {LY_STMT_REFERENCE, &ident->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_STATUS, &ident->flags, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                        };
+        {LY_STMT_BASE, &ident->bases, 0},
+        {LY_STMT_DESCRIPTION, &ident->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_IF_FEATURE, &ident->iffeatures, YIN_SUBELEM_VER2},
+        {LY_STMT_REFERENCE, &ident->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_STATUS, &ident->flags, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+    };
     return yin_parse_content(ctx, subelems, 6, LY_STMT_IDENTITY, NULL, &ident->exts);
 }
 
@@ -2470,8 +2470,8 @@
         d = calloc(1, sizeof *d);
         LY_CHECK_ERR_RET(!d, LOGMEM(ctx->xmlctx->ctx), LY_EMEM);
         struct yin_subelement subelems[1] = {
-                                                {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
-                                            };
+            {LY_STMT_EXTENSION_INSTANCE, NULL, 0}
+        };
         ret = yin_parse_content(ctx, subelems, 1, LY_STMT_DEVIATE, NULL, &d->exts);
 
     } else if (dev_mod == LYS_DEV_ADD) {
@@ -2481,16 +2481,16 @@
         struct minmax_dev_meta min = {&d_add->min, &d_add->flags, &d_add->exts};
         struct minmax_dev_meta max = {&d_add->max, &d_add->flags, &d_add->exts};
         struct yin_subelement subelems[9] = {
-                                                {LY_STMT_CONFIG, &d_add->flags, YIN_SUBELEM_UNIQUE},
-                                                {LY_STMT_DEFAULT, &d_add->dflts, 0},
-                                                {LY_STMT_MANDATORY, &d_add->flags, YIN_SUBELEM_UNIQUE},
-                                                {LY_STMT_MAX_ELEMENTS, &max, YIN_SUBELEM_UNIQUE},
-                                                {LY_STMT_MIN_ELEMENTS, &min, YIN_SUBELEM_UNIQUE},
-                                                {LY_STMT_MUST, &d_add->musts, 0},
-                                                {LY_STMT_UNIQUE, &d_add->uniques, 0},
-                                                {LY_STMT_UNITS, &d_add->units, YIN_SUBELEM_UNIQUE},
-                                                {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                            };
+            {LY_STMT_CONFIG, &d_add->flags, YIN_SUBELEM_UNIQUE},
+            {LY_STMT_DEFAULT, &d_add->dflts, 0},
+            {LY_STMT_MANDATORY, &d_add->flags, YIN_SUBELEM_UNIQUE},
+            {LY_STMT_MAX_ELEMENTS, &max, YIN_SUBELEM_UNIQUE},
+            {LY_STMT_MIN_ELEMENTS, &min, YIN_SUBELEM_UNIQUE},
+            {LY_STMT_MUST, &d_add->musts, 0},
+            {LY_STMT_UNIQUE, &d_add->uniques, 0},
+            {LY_STMT_UNITS, &d_add->units, YIN_SUBELEM_UNIQUE},
+            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+        };
         ret = yin_parse_content(ctx, subelems, 9, LY_STMT_DEVIATE, NULL, &d_add->exts);
 
     } else if (dev_mod == LYS_DEV_REPLACE) {
@@ -2500,15 +2500,15 @@
         struct minmax_dev_meta min = {&d_rpl->min, &d_rpl->flags, &d_rpl->exts};
         struct minmax_dev_meta max = {&d_rpl->max, &d_rpl->flags, &d_rpl->exts};
         struct yin_subelement subelems[8] = {
-                                                {LY_STMT_CONFIG, &d_rpl->flags, YIN_SUBELEM_UNIQUE},
-                                                {LY_STMT_DEFAULT, &d_rpl->dflt, YIN_SUBELEM_UNIQUE},
-                                                {LY_STMT_MANDATORY, &d_rpl->flags, YIN_SUBELEM_UNIQUE},
-                                                {LY_STMT_MAX_ELEMENTS, &max, YIN_SUBELEM_UNIQUE},
-                                                {LY_STMT_MIN_ELEMENTS, &min, YIN_SUBELEM_UNIQUE},
-                                                {LY_STMT_TYPE, &d_rpl->type, YIN_SUBELEM_UNIQUE},
-                                                {LY_STMT_UNITS, &d_rpl->units, YIN_SUBELEM_UNIQUE},
-                                                {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                            };
+            {LY_STMT_CONFIG, &d_rpl->flags, YIN_SUBELEM_UNIQUE},
+            {LY_STMT_DEFAULT, &d_rpl->dflt, YIN_SUBELEM_UNIQUE},
+            {LY_STMT_MANDATORY, &d_rpl->flags, YIN_SUBELEM_UNIQUE},
+            {LY_STMT_MAX_ELEMENTS, &max, YIN_SUBELEM_UNIQUE},
+            {LY_STMT_MIN_ELEMENTS, &min, YIN_SUBELEM_UNIQUE},
+            {LY_STMT_TYPE, &d_rpl->type, YIN_SUBELEM_UNIQUE},
+            {LY_STMT_UNITS, &d_rpl->units, YIN_SUBELEM_UNIQUE},
+            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+        };
         ret = yin_parse_content(ctx, subelems, 8,  LY_STMT_DEVIATE, NULL, &d_rpl->exts);
 
     } else {
@@ -2516,12 +2516,12 @@
         LY_CHECK_ERR_RET(!d_del, LOGMEM(ctx->xmlctx->ctx), LY_EMEM);
         d = (struct lysp_deviate *)d_del;
         struct yin_subelement subelems[5] = {
-                                                {LY_STMT_DEFAULT, &d_del->dflts, 0},
-                                                {LY_STMT_MUST, &d_del->musts, 0},
-                                                {LY_STMT_UNIQUE, &d_del->uniques, 0},
-                                                {LY_STMT_UNITS, &d_del->units, YIN_SUBELEM_UNIQUE},
-                                                {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                            };
+            {LY_STMT_DEFAULT, &d_del->dflts, 0},
+            {LY_STMT_MUST, &d_del->musts, 0},
+            {LY_STMT_UNIQUE, &d_del->uniques, 0},
+            {LY_STMT_UNITS, &d_del->units, YIN_SUBELEM_UNIQUE},
+            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+        };
         ret = yin_parse_content(ctx, subelems, 5, LY_STMT_DEVIATE, NULL, &d_del->exts);
     }
     LY_CHECK_GOTO(ret, cleanup);
@@ -2558,11 +2558,11 @@
     LY_CHECK_RET(yin_parse_attribute(ctx, YIN_ARG_TARGET_NODE, &dev->nodeid, Y_STR_ARG, LY_STMT_DEVIATION));
     CHECK_NONEMPTY((struct lys_parser_ctx *)ctx, strlen(dev->nodeid), "deviation");
     struct yin_subelement subelems[4] = {
-                                            {LY_STMT_DESCRIPTION, &dev->dsc, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_DEVIATE, &dev->deviates, YIN_SUBELEM_MANDATORY},
-                                            {LY_STMT_REFERENCE, &dev->ref, YIN_SUBELEM_UNIQUE},
-                                            {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
-                                        };
+        {LY_STMT_DESCRIPTION, &dev->dsc, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_DEVIATE, &dev->deviates, YIN_SUBELEM_MANDATORY},
+        {LY_STMT_REFERENCE, &dev->ref, YIN_SUBELEM_UNIQUE},
+        {LY_STMT_EXTENSION_INSTANCE, NULL, 0},
+    };
     return yin_parse_content(ctx, subelems, 4, LY_STMT_DEVIATION, NULL, &dev->exts);
 }
 
@@ -2659,54 +2659,54 @@
 kw2kw_group(struct lys_yin_parser_ctx *ctx, enum ly_stmt kw, enum yang_module_stmt *group)
 {
     switch (kw) {
-        /* module header */
-        case LY_STMT_NONE:
-        case LY_STMT_NAMESPACE:
-        case LY_STMT_PREFIX:
-        case LY_STMT_BELONGS_TO:
-        case LY_STMT_YANG_VERSION:
-            *group = Y_MOD_MODULE_HEADER;
-            break;
-        /* linkage */
-        case LY_STMT_INCLUDE:
-        case LY_STMT_IMPORT:
-            *group = Y_MOD_LINKAGE;
-            break;
-        /* meta */
-        case LY_STMT_ORGANIZATION:
-        case LY_STMT_CONTACT:
-        case LY_STMT_DESCRIPTION:
-        case LY_STMT_REFERENCE:
-            *group = Y_MOD_META;
-            break;
-        /* revision */
-        case LY_STMT_REVISION:
-            *group = Y_MOD_REVISION;
-            break;
-        /* body */
-        case LY_STMT_ANYDATA:
-        case LY_STMT_ANYXML:
-        case LY_STMT_AUGMENT:
-        case LY_STMT_CHOICE:
-        case LY_STMT_CONTAINER:
-        case LY_STMT_DEVIATION:
-        case LY_STMT_EXTENSION:
-        case LY_STMT_FEATURE:
-        case LY_STMT_GROUPING:
-        case LY_STMT_IDENTITY:
-        case LY_STMT_LEAF:
-        case LY_STMT_LEAF_LIST:
-        case LY_STMT_LIST:
-        case LY_STMT_NOTIFICATION:
-        case LY_STMT_RPC:
-        case LY_STMT_TYPEDEF:
-        case LY_STMT_USES:
-        case LY_STMT_EXTENSION_INSTANCE:
-            *group = Y_MOD_BODY;
-            break;
-        default:
-            LOGINT(ctx->xmlctx->ctx);
-            return LY_EINT;
+    /* module header */
+    case LY_STMT_NONE:
+    case LY_STMT_NAMESPACE:
+    case LY_STMT_PREFIX:
+    case LY_STMT_BELONGS_TO:
+    case LY_STMT_YANG_VERSION:
+        *group = Y_MOD_MODULE_HEADER;
+        break;
+    /* linkage */
+    case LY_STMT_INCLUDE:
+    case LY_STMT_IMPORT:
+        *group = Y_MOD_LINKAGE;
+        break;
+    /* meta */
+    case LY_STMT_ORGANIZATION:
+    case LY_STMT_CONTACT:
+    case LY_STMT_DESCRIPTION:
+    case LY_STMT_REFERENCE:
+        *group = Y_MOD_META;
+        break;
+    /* revision */
+    case LY_STMT_REVISION:
+        *group = Y_MOD_REVISION;
+        break;
+    /* body */
+    case LY_STMT_ANYDATA:
+    case LY_STMT_ANYXML:
+    case LY_STMT_AUGMENT:
+    case LY_STMT_CHOICE:
+    case LY_STMT_CONTAINER:
+    case LY_STMT_DEVIATION:
+    case LY_STMT_EXTENSION:
+    case LY_STMT_FEATURE:
+    case LY_STMT_GROUPING:
+    case LY_STMT_IDENTITY:
+    case LY_STMT_LEAF:
+    case LY_STMT_LEAF_LIST:
+    case LY_STMT_LIST:
+    case LY_STMT_NOTIFICATION:
+    case LY_STMT_RPC:
+    case LY_STMT_TYPEDEF:
+    case LY_STMT_USES:
+    case LY_STMT_EXTENSION_INSTANCE:
+        *group = Y_MOD_BODY;
+        break;
+    default:
+        LOGINT(ctx->xmlctx->ctx);
+        return LY_EINT;
     }
 
     return LY_SUCCESS;
@@ -2781,7 +2781,7 @@
 
 LY_ERR
 yin_parse_content(struct lys_yin_parser_ctx *ctx, struct yin_subelement *subelem_info, size_t subelem_info_size,
-                  enum ly_stmt current_element, const char **text_content, struct lysp_ext_instance **exts)
+        enum ly_stmt current_element, const char **text_content, struct lysp_ext_instance **exts)
 {
     LY_ERR ret = LY_SUCCESS;
     enum LYXML_PARSER_STATUS next_status;
@@ -2853,7 +2853,7 @@
             /* call responsible function */
             case LY_STMT_EXTENSION_INSTANCE:
                 ret = yin_parse_extension_instance(ctx, kw2lyext_substmt(current_element),
-                                                   (subelem->dest) ? *((LY_ARRAY_COUNT_TYPE*)subelem->dest) : 0, exts);
+                                (subelem->dest) ? *((LY_ARRAY_COUNT_TYPE*)subelem->dest) : 0, exts);
                 break;
             case LY_STMT_ACTION:
             case LY_STMT_RPC:
@@ -3071,7 +3071,7 @@
 
 LY_ERR
 yin_parse_extension_instance(struct lys_yin_parser_ctx *ctx, LYEXT_SUBSTMT subelem, LY_ARRAY_COUNT_TYPE subelem_index,
-                             struct lysp_ext_instance **exts)
+        struct lysp_ext_instance **exts)
 {
     struct lysp_ext_instance *e;
     struct lysp_stmt *last_subelem = NULL, *new_subelem = NULL;
@@ -3263,7 +3263,7 @@
         /* parse child element */
         child = yin_match_keyword(ctx, ctx->xmlctx->name, ctx->xmlctx->name_len, ctx->xmlctx->prefix, ctx->xmlctx->prefix_len, elem_type);
         if ((elem_type == LY_STMT_ERROR_MESSAGE && child != LY_STMT_ARG_VALUE) ||
-            (elem_type != LY_STMT_ERROR_MESSAGE && child != LY_STMT_ARG_TEXT)) {
+                (elem_type != LY_STMT_ERROR_MESSAGE && child != LY_STMT_ARG_TEXT)) {
             LOGVAL_PARSER((struct lys_parser_ctx *)ctx, LY_VCODE_UNEXP_SUBELEM, ctx->xmlctx->name_len, ctx->xmlctx->name,
                           ly_stmt2str(elem_type));
             return LY_EVALID;
@@ -3504,7 +3504,7 @@
 
 LY_ERR
 yin_parse_submodule(struct lys_yin_parser_ctx **yin_ctx, struct ly_ctx *ctx, struct lys_parser_ctx *main_ctx,
-                    struct ly_in *in, struct lysp_submodule **submod)
+        struct ly_in *in, struct lysp_submodule **submod)
 {
     enum ly_stmt kw = LY_STMT_NONE;
     LY_ERR ret = LY_SUCCESS;
@@ -3523,7 +3523,7 @@
 
     /* check submodule */
     kw = yin_match_keyword(*yin_ctx, (*yin_ctx)->xmlctx->name, (*yin_ctx)->xmlctx->name_len, (*yin_ctx)->xmlctx->prefix,
-                           (*yin_ctx)->xmlctx->prefix_len, LY_STMT_NONE);
+                    (*yin_ctx)->xmlctx->prefix_len, LY_STMT_NONE);
     if (kw == LY_STMT_MODULE) {
         LOGERR(ctx, LY_EDENIED, "Input data contains module in situation when a submodule is expected.");
         ret = LY_EINVAL;
@@ -3580,7 +3580,7 @@
 
     /* check module */
     kw = yin_match_keyword(*yin_ctx, (*yin_ctx)->xmlctx->name, (*yin_ctx)->xmlctx->name_len, (*yin_ctx)->xmlctx->prefix,
-                           (*yin_ctx)->xmlctx->prefix_len, LY_STMT_NONE);
+                    (*yin_ctx)->xmlctx->prefix_len, LY_STMT_NONE);
     if (kw == LY_STMT_SUBMODULE) {
         LOGERR(mod->ctx, LY_EDENIED, "Input data contains submodule which cannot be parsed directly without its main module.");
         ret = LY_EINVAL;
diff --git a/src/parser_yin.h b/src/parser_yin.h
index 7ab6c86..47d3246 100644
--- a/src/parser_yin.h
+++ b/src/parser_yin.h
@@ -139,7 +139,7 @@
  * @return LY_ERR values.
  */
 LY_ERR yin_parse_content(struct lys_yin_parser_ctx *ctx, struct yin_subelement *subelem_info, size_t subelem_info_size,
-                         enum ly_stmt current_element, const char **text_content, struct lysp_ext_instance **exts);
+        enum ly_stmt current_element, const char **text_content, struct lysp_ext_instance **exts);
 
 /**
  * @brief Check that val is valid UTF8 character sequence of val_type.
@@ -165,7 +165,7 @@
  * @return yang_keyword values.
  */
 enum ly_stmt yin_match_keyword(struct lys_yin_parser_ctx *ctx, const char *name, size_t name_len,
-                               const char *prefix, size_t prefix_len, enum ly_stmt parrent);
+        const char *prefix, size_t prefix_len, enum ly_stmt parrent);
 
 /**
  * @brief Parse instance of extension.
@@ -178,7 +178,7 @@
  * @return LY_ERR values.
  */
 LY_ERR yin_parse_extension_instance(struct lys_yin_parser_ctx *ctx, LYEXT_SUBSTMT subelem, LY_ARRAY_COUNT_TYPE subelem_index,
-                                    struct lysp_ext_instance **exts);
+        struct lysp_ext_instance **exts);
 
 /**
  * @brief Parse yin element into generic structure.
diff --git a/src/path.c b/src/path.c
index 70ec02a..5a65ada 100644
--- a/src/path.c
+++ b/src/path.c
@@ -46,7 +46,7 @@
  */
 static LY_ERR
 ly_path_check_predicate(const struct ly_ctx *ctx, const struct lysc_node *cur_node, const struct lyxp_expr *exp,
-                        uint16_t *tok_idx, uint8_t prefix, uint8_t pred)
+        uint16_t *tok_idx, uint8_t prefix, uint8_t pred)
 {
     struct ly_set *set = NULL;
     uint32_t i;
@@ -108,7 +108,7 @@
                 /* ']' */
                 LY_CHECK_GOTO(lyxp_next_token(ctx, exp, tok_idx, LYXP_TOKEN_BRACK2), error);
 
-            /* '[' */
+                /* '[' */
             } while (!lyxp_next_token(NULL, exp, tok_idx, LYXP_TOKEN_BRACK1));
 
         } else if ((pred == LY_PATH_PRED_SIMPLE) && !lyxp_next_token(NULL, exp, tok_idx, LYXP_TOKEN_DOT)) {
@@ -202,7 +202,7 @@
                 /* ']' */
                 LY_CHECK_GOTO(lyxp_next_token(ctx, exp, tok_idx, LYXP_TOKEN_BRACK2), error);
 
-            /* '[' */
+                /* '[' */
             } while (!lyxp_next_token(NULL, exp, tok_idx, LYXP_TOKEN_BRACK1));
 
         } else {
@@ -222,7 +222,7 @@
 
 LY_ERR
 ly_path_parse(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *str_path, size_t path_len,
-              uint8_t begin, uint8_t lref, uint8_t prefix, uint8_t pred, struct lyxp_expr **expr)
+        uint8_t begin, uint8_t lref, uint8_t prefix, uint8_t pred, struct lyxp_expr **expr)
 {
     struct lyxp_expr *exp;
     uint16_t tok_idx, cur_len;
@@ -295,7 +295,7 @@
         /* Predicate* */
         LY_CHECK_GOTO(ly_path_check_predicate(ctx, ctx_node, exp, &tok_idx, prefix, pred), error);
 
-    /* '/' */
+        /* '/' */
     } while (!lyxp_next_token(NULL, exp, &tok_idx, LYXP_TOKEN_OPER_PATH));
 
     /* trailing token check */
@@ -315,7 +315,7 @@
 
 LY_ERR
 ly_path_parse_predicate(const struct ly_ctx *ctx, const struct lysc_node *cur_node, const char *str_path,
-                        size_t path_len, uint8_t prefix, uint8_t pred, struct lyxp_expr **expr)
+        size_t path_len, uint8_t prefix, uint8_t pred, struct lyxp_expr **expr)
 {
     struct lyxp_expr *exp;
     uint16_t tok_idx;
@@ -364,9 +364,9 @@
  */
 static LY_ERR
 ly_path_compile_prefix(const struct ly_ctx *ctx, const struct lysc_node *cur_node, const struct lys_module *cur_mod,
-                       const struct lysc_node *prev_ctx_node, const struct lyxp_expr *expr, uint16_t tok_idx,
-                       uint8_t lref, LY_PREFIX_FORMAT format, void *prefix_data, const struct lys_module **mod,
-                       const char **name, size_t *name_len)
+        const struct lysc_node *prev_ctx_node, const struct lyxp_expr *expr, uint16_t tok_idx,
+        uint8_t lref, LY_PREFIX_FORMAT format, void *prefix_data, const struct lys_module **mod,
+        const char **name, size_t *name_len)
 {
     const char *ptr;
     size_t len;
@@ -422,9 +422,9 @@
 
 LY_ERR
 ly_path_compile_predicate(const struct ly_ctx *ctx, const struct lysc_node *cur_node, const struct lys_module *cur_mod,
-                          const struct lysc_node *ctx_node, const struct lyxp_expr *expr, uint16_t *tok_idx,
-                          LY_PREFIX_FORMAT format, void *prefix_data, struct ly_path_predicate **predicates,
-                          enum ly_path_pred_type *pred_type)
+        const struct lysc_node *ctx_node, const struct lyxp_expr *expr, uint16_t *tok_idx,
+        LY_PREFIX_FORMAT format, void *prefix_data, struct ly_path_predicate **predicates,
+        enum ly_path_pred_type *pred_type)
 {
     struct ly_path_predicate *p;
     const struct lysc_node *key;
@@ -572,7 +572,7 @@
  */
 static LY_ERR
 ly_path_compile_predicate_leafref(const struct lysc_node *ctx_node, const struct lysc_node *cur_node,
-                                  const struct lyxp_expr *expr, uint16_t *tok_idx, LY_PREFIX_FORMAT format, void *prefix_data)
+        const struct lyxp_expr *expr, uint16_t *tok_idx, LY_PREFIX_FORMAT format, void *prefix_data)
 {
     const struct lysc_node *key, *node, *node2;
     const struct lys_module *mod;
@@ -681,7 +681,7 @@
         assert(expr->tokens[*tok_idx] == LYXP_TOKEN_BRACK2);
         ++(*tok_idx);
 
-    /* another predicate follows? */
+        /* another predicate follows? */
     } while (!lyxp_next_token(NULL, expr, tok_idx, LYXP_TOKEN_BRACK1));
 
     return LY_SUCCESS;
@@ -689,8 +689,8 @@
 
 LY_ERR
 ly_path_compile(const struct ly_ctx *ctx, const struct lys_module *cur_mod, const struct lysc_node *ctx_node,
-                const struct lyxp_expr *expr, uint8_t lref, uint8_t oper, uint8_t target, LY_PREFIX_FORMAT format,
-                void *prefix_data, struct ly_path **path)
+        const struct lyxp_expr *expr, uint8_t lref, uint8_t oper, uint8_t target, LY_PREFIX_FORMAT format,
+        void *prefix_data, struct ly_path **path)
 {
     LY_ERR ret = LY_SUCCESS;
     uint16_t tok_idx = 0;
@@ -801,7 +801,7 @@
 
 LY_ERR
 ly_path_eval_partial(const struct ly_path *path, const struct lyd_node *start, LY_ARRAY_COUNT_TYPE *path_idx,
-                     struct lyd_node **match)
+        struct lyd_node **match)
 {
     LY_ARRAY_COUNT_TYPE u;
     struct lyd_node *prev_node = NULL, *node, *target;
@@ -961,7 +961,7 @@
 
 void
 ly_path_predicates_free(const struct ly_ctx *ctx, enum ly_path_pred_type pred_type, const struct lysc_node *llist,
-                        struct ly_path_predicate *predicates)
+        struct ly_path_predicate *predicates)
 {
     LY_ARRAY_COUNT_TYPE u;
 
diff --git a/src/path.h b/src/path.h
index 11e2289..5414d6f 100644
--- a/src/path.h
+++ b/src/path.h
@@ -107,7 +107,7 @@
  * @return LY_ERR value.
  */
 LY_ERR ly_path_parse(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *str_path, size_t path_len,
-                     uint8_t begin, uint8_t lref, uint8_t prefix, uint8_t pred, struct lyxp_expr **expr);
+        uint8_t begin, uint8_t lref, uint8_t prefix, uint8_t pred, struct lyxp_expr **expr);
 
 /**
  * @brief Parse predicate into XPath token structure and perform all additional checks.
@@ -122,7 +122,7 @@
  * @return LY_ERR value.
  */
 LY_ERR ly_path_parse_predicate(const struct ly_ctx *ctx, const struct lysc_node *cur_node, const char *str_path,
-                               size_t path_len, uint8_t prefix, uint8_t pred, struct lyxp_expr **expr);
+        size_t path_len, uint8_t prefix, uint8_t pred, struct lyxp_expr **expr);
 
 /**
  * @defgroup path_oper_options Path operation options.
@@ -158,8 +158,8 @@
  * @return LY_ERR value.
  */
 LY_ERR ly_path_compile(const struct ly_ctx *ctx, const struct lys_module *cur_mod, const struct lysc_node *ctx_node,
-                       const struct lyxp_expr *expr, uint8_t lref, uint8_t oper, uint8_t target,
-                       LY_PREFIX_FORMAT format, void *prefix_data, struct ly_path **path);
+        const struct lyxp_expr *expr, uint8_t lref, uint8_t oper, uint8_t target,
+        LY_PREFIX_FORMAT format, void *prefix_data, struct ly_path **path);
 
 /**
  * @brief Compile predicate into ly_path_predicate structure. Only simple predicates (not leafref) are supported.
@@ -177,9 +177,9 @@
  * @return LY_ERR value.
  */
 LY_ERR ly_path_compile_predicate(const struct ly_ctx *ctx, const struct lysc_node *cur_node, const struct lys_module *cur_mod,
-                                 const struct lysc_node *ctx_node, const struct lyxp_expr *expr, uint16_t *tok_idx,
-                                 LY_PREFIX_FORMAT format, void *prefix_data, struct ly_path_predicate **predicates,
-                                 enum ly_path_pred_type *pred_type);
+        const struct lysc_node *ctx_node, const struct lyxp_expr *expr, uint16_t *tok_idx,
+        LY_PREFIX_FORMAT format, void *prefix_data, struct ly_path_predicate **predicates,
+        enum ly_path_pred_type *pred_type);
 
 /**
  * @brief Resolve at least partially the target defined by ly_path structure. Not supported for leafref!
@@ -194,7 +194,7 @@
  * @return LY_ERR on another error.
  */
 LY_ERR ly_path_eval_partial(const struct ly_path *path, const struct lyd_node *start, LY_ARRAY_COUNT_TYPE *path_idx,
-                            struct lyd_node **match);
+        struct lyd_node **match);
 
 /**
  * @brief Resolve the target defined by ly_path structure. Not supported for leafref!
@@ -227,7 +227,7 @@
  * @param[in] predicates Predicates ([sized array](@ref sizedarrays)) to free.
  */
 void ly_path_predicates_free(const struct ly_ctx *ctx, enum ly_path_pred_type pred_type, const struct lysc_node *llist,
-                             struct ly_path_predicate *predicates);
+        struct ly_path_predicate *predicates);
 
 /**
  * @brief Free ly_path structure.
diff --git a/src/plugins_exts.c b/src/plugins_exts.c
index 1b63d52..90e4de4 100644
--- a/src/plugins_exts.c
+++ b/src/plugins_exts.c
@@ -87,23 +87,23 @@
         return "extension instance";
     case LYEXT_PAR_IMPORT:
         return "import";
-/* YANG allows extension instances inside the following statements,
- * but they do not have any meaning in current libyang
-    case LYEXT_PAR_TPDF:
-        return "typedef";
-    case LYEXT_PAR_EXTINST:
-        return "extension";
-    case LYEXT_PAR_REFINE:
-        return "refine";
-    case LYEXT_PAR_DEVIATION:
-        return "deviation";
-    case LYEXT_PAR_DEVIATE:
-        return "deviate";
-    case LYEXT_PAR_INCLUDE:
-        return "include";
-    case LYEXT_PAR_REVISION:
-        return "revision";
- */
+    /* YANG allows extension instances inside the following statements,
+     * but they do not have any meaning in current libyang
+        case LYEXT_PAR_TPDF:
+            return "typedef";
+        case LYEXT_PAR_EXTINST:
+            return "extension";
+        case LYEXT_PAR_REFINE:
+            return "refine";
+        case LYEXT_PAR_DEVIATION:
+            return "deviation";
+        case LYEXT_PAR_DEVIATE:
+            return "deviate";
+        case LYEXT_PAR_INCLUDE:
+            return "include";
+        case LYEXT_PAR_REVISION:
+            return "revision";
+     */
     default:
         return "unknown";
     }
diff --git a/src/plugins_exts.h b/src/plugins_exts.h
index f511710..8a4033b 100644
--- a/src/plugins_exts.h
+++ b/src/plugins_exts.h
@@ -26,7 +26,6 @@
 extern "C" {
 #endif
 
-
 /**
  * @defgroup extensions YANG Extensions
  *
@@ -178,7 +177,6 @@
     struct lyext_plugin *plugin; /**< plugin for the extension */
 };
 
-
 /**
  * @brief Provide a log message from an extension plugin.
  *
diff --git a/src/plugins_exts_metadata.c b/src/plugins_exts_metadata.c
index 0c116af..3a85eed 100644
--- a/src/plugins_exts_metadata.c
+++ b/src/plugins_exts_metadata.c
@@ -103,8 +103,8 @@
     annotation_substmt[2].storage = &annotation->flags;
     annotation_substmt[3].storage = &annotation->type;
 
-   lysc_extension_instance_free(ctx, annotation_substmt);
-   free(ext->data);
+    lysc_extension_instance_free(ctx, annotation_substmt);
+    free(ext->data);
 }
 
 /**
diff --git a/src/plugins_exts_metadata.h b/src/plugins_exts_metadata.h
index 653a5f1..97bfae5 100644
--- a/src/plugins_exts_metadata.h
+++ b/src/plugins_exts_metadata.h
@@ -31,7 +31,6 @@
     uint16_t flags;                    /**< [schema node flags](@ref snodeflags) - only LYS_STATUS_* values are allowed */
 };
 
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/plugins_exts_nacm.c b/src/plugins_exts_nacm.c
index 5f131b1..9565e86 100644
--- a/src/plugins_exts_nacm.c
+++ b/src/plugins_exts_nacm.c
@@ -115,7 +115,6 @@
     return LY_SUCCESS;
 }
 
-
 /**
  * @brief Plugin for the NACM's default-deny-write and default-deny-all extensions
  */
diff --git a/src/plugins_types.c b/src/plugins_types.c
index 788a5cb..83f9bd4 100644
--- a/src/plugins_types.c
+++ b/src/plugins_types.c
@@ -174,7 +174,7 @@
  */
 static const char *
 ly_type_print_simple(const struct lyd_value *value, LY_PREFIX_FORMAT UNUSED(format),
-                        void *UNUSED(prefix_data), int *dynamic)
+        void *UNUSED(prefix_data), int *dynamic)
 {
     *dynamic = 0;
     return (char *)value->canonical;
@@ -208,7 +208,7 @@
 
 API LY_ERR
 ly_type_parse_int(const char *datatype, int base, int64_t min, int64_t max, const char *value, size_t value_len,
-                  int64_t *ret, struct ly_err_item **err)
+        int64_t *ret, struct ly_err_item **err)
 {
     char *errmsg = NULL;
     int rc = 0;
@@ -216,7 +216,7 @@
     LY_CHECK_ARG_RET(NULL, err, datatype, LY_EINVAL);
 
     /* consume leading whitespaces */
-    for (;value_len && isspace(*value); ++value, --value_len) {}
+    for (; value_len && isspace(*value); ++value, --value_len) {}
 
     if (!value || !value[0] || !value_len) {
         rc = asprintf(&errmsg, "Invalid empty %s value.", datatype);
@@ -246,7 +246,7 @@
 
 API LY_ERR
 ly_type_parse_uint(const char *datatype, int base, uint64_t max, const char *value, size_t value_len, uint64_t *ret,
-                   struct ly_err_item **err)
+        struct ly_err_item **err)
 {
     char *errmsg = NULL;
     int rc = 0;
@@ -254,7 +254,7 @@
     LY_CHECK_ARG_RET(NULL, err, datatype, LY_EINVAL);
 
     /* consume leading whitespaces */
-    for (;value_len && isspace(*value); ++value, --value_len) {}
+    for (; value_len && isspace(*value); ++value, --value_len) {}
 
     if (!value || !value[0] || !value_len) {
         rc = asprintf(&errmsg, "Invalid empty %s value.", datatype);
@@ -293,7 +293,7 @@
     int64_t d;
 
     /* consume leading whitespaces */
-    for (;value_len && isspace(*value); ++value, --value_len) {}
+    for (; value_len && isspace(*value); ++value, --value_len) {}
 
     /* parse value */
     if (!value_len) {
@@ -443,7 +443,7 @@
 
 API LY_ERR
 ly_type_validate_range(LY_DATA_TYPE basetype, struct lysc_range *range, int64_t value, const char *strval,
-                       struct ly_err_item **err)
+        struct ly_err_item **err)
 {
     LY_ARRAY_COUNT_TYPE u;
     char *errmsg = NULL;
@@ -457,8 +457,8 @@
                     errmsg = strdup(range->emsg);
                 } else {
                     rc = asprintf(&errmsg, "%s \"%s\" does not satisfy the %s constraint.",
-                                  (basetype == LY_TYPE_BINARY || basetype == LY_TYPE_STRING) ? "Length" : "Value", strval,
-                                  (basetype == LY_TYPE_BINARY || basetype == LY_TYPE_STRING) ? "length" : "range");
+                                    (basetype == LY_TYPE_BINARY || basetype == LY_TYPE_STRING) ? "Length" : "Value", strval,
+                                    (basetype == LY_TYPE_BINARY || basetype == LY_TYPE_STRING) ? "length" : "range");
                 }
                 goto error;
             } else if ((uint64_t)value <= range->parts[u].max_u64) {
@@ -470,8 +470,8 @@
                     errmsg = strdup(range->emsg);
                 } else {
                     rc = asprintf(&errmsg, "%s \"%s\" does not satisfy the %s constraint.",
-                                  (basetype == LY_TYPE_BINARY || basetype == LY_TYPE_STRING) ? "Length" : "Value", strval,
-                                  (basetype == LY_TYPE_BINARY || basetype == LY_TYPE_STRING) ? "length" : "range");
+                                    (basetype == LY_TYPE_BINARY || basetype == LY_TYPE_STRING) ? "Length" : "Value", strval,
+                                    (basetype == LY_TYPE_BINARY || basetype == LY_TYPE_STRING) ? "length" : "range");
                 }
                 goto error;
             }
@@ -518,8 +518,8 @@
  */
 static LY_ERR
 ly_type_store_int(const struct ly_ctx *ctx, struct lysc_type *type, const char *value, size_t value_len, int options,
-                  LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), const void *UNUSED(context_node),
-                  const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
+        LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), const void *UNUSED(context_node),
+        const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
 {
     LY_ERR ret;
     int64_t num;
@@ -549,7 +549,7 @@
         LOGINT_RET(ctx);
     }
 
-    LY_CHECK_RET(asprintf(&str, "%"PRId64, num) == -1, LY_EMEM);
+    LY_CHECK_RET(asprintf(&str, "%" PRId64, num) == -1, LY_EMEM);
 
     /* range of the number */
     if (type_num->range) {
@@ -574,8 +574,8 @@
  */
 static LY_ERR
 ly_type_store_uint(const struct ly_ctx *ctx, struct lysc_type *type, const char *value, size_t value_len, int options,
-                   LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), const void *UNUSED(context_node),
-                   const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
+        LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), const void *UNUSED(context_node),
+        const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
 {
     LY_ERR ret;
     uint64_t num;
@@ -603,7 +603,7 @@
         LOGINT_RET(ctx);
     }
 
-    LY_CHECK_RET(asprintf(&str, "%"PRIu64, num) == -1, LY_EMEM);
+    LY_CHECK_RET(asprintf(&str, "%" PRIu64, num) == -1, LY_EMEM);
 
     /* range of the number */
     if (type_num->range) {
@@ -628,8 +628,8 @@
  */
 static LY_ERR
 ly_type_store_decimal64(const struct ly_ctx *ctx, struct lysc_type *type, const char *value, size_t value_len, int options,
-                        LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), const void *UNUSED(context_node),
-                        const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
+        LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), const void *UNUSED(context_node),
+        const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
 {
     int64_t d;
     struct lysc_type_dec* type_dec = (struct lysc_type_dec*)type;
@@ -647,14 +647,14 @@
     LY_CHECK_RET(ly_type_parse_dec64(type_dec->fraction_digits, value, value_len, &d, err));
     /* prepare canonized value */
     if (d) {
-        int count = sprintf(buf, "%"PRId64" ", d);
+        int count = sprintf(buf, "%" PRId64 " ", d);
         if ( (d > 0 && (count - 1) <= type_dec->fraction_digits)
-             || (count - 2) <= type_dec->fraction_digits ) {
+                || (count - 2) <= type_dec->fraction_digits ) {
             /* we have 0. value, print the value with the leading zeros
              * (one for 0. and also keep the correct with of num according
              * to fraction-digits value)
              * for (num<0) - extra character for '-' sign */
-            count = sprintf(buf, "%0*"PRId64" ", (d > 0) ? (type_dec->fraction_digits + 1) : (type_dec->fraction_digits + 2), d);
+            count = sprintf(buf, "%0*" PRId64 " ", (d > 0) ? (type_dec->fraction_digits + 1) : (type_dec->fraction_digits + 2), d);
         }
         for (int i = type_dec->fraction_digits, j = 1; i > 0 ; i--) {
             if (j && i > 1 && buf[count - 2] == '0') {
@@ -694,8 +694,8 @@
  */
 static LY_ERR
 ly_type_store_binary(const struct ly_ctx *ctx, struct lysc_type *type, const char *value, size_t value_len, int options,
-                     LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), const void *UNUSED(context_node),
-                     const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
+        LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), const void *UNUSED(context_node),
+        const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
 {
     size_t start = 0, stop = 0, count = 0, u, termination = 0;
     struct lysc_type_bin *type_bin = (struct lysc_type_bin *)type;
@@ -738,7 +738,7 @@
                         termination = 2;
                         count++;
                         u++;
-                    } else if (u == stop){
+                    } else if (u == stop) {
                         termination = 1;
                     }
                 }
@@ -762,7 +762,7 @@
     if (type_bin->length) {
         char buf[22];
         uint64_t len = ((count / 4) * 3) - termination;
-        snprintf(buf, 22, "%"PRIu64, len);
+        snprintf(buf, 22, "%" PRIu64, len);
         LY_CHECK_RET(ly_type_validate_range(LY_TYPE_BINARY, type_bin->length, len, buf, err));
     }
 
@@ -797,8 +797,8 @@
  */
 static LY_ERR
 ly_type_store_string(const struct ly_ctx *ctx, struct lysc_type *type, const char *value, size_t value_len, int options,
-                     LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), const void *UNUSED(context_node),
-                     const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
+        LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), const void *UNUSED(context_node),
+        const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
 {
     struct lysc_type_str *type_str = (struct lysc_type_str *)type;
 
@@ -837,8 +837,8 @@
  */
 static LY_ERR
 ly_type_store_bits(const struct ly_ctx *ctx, struct lysc_type *type, const char *value, size_t value_len, int options,
-                   LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), const void *UNUSED(context_node),
-                   const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
+        LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), const void *UNUSED(context_node),
+        const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
 {
     LY_ERR ret = LY_EVALID;
     size_t item_len;
@@ -1026,8 +1026,8 @@
  */
 static LY_ERR
 ly_type_store_enum(const struct ly_ctx *ctx, struct lysc_type *type, const char *value, size_t value_len, int options,
-                   LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), const void *UNUSED(context_node),
-                   const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
+        LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data), const void *UNUSED(context_node),
+        const struct lyd_node *UNUSED(tree), struct lyd_value *storage, struct ly_err_item **err)
 {
     LY_ARRAY_COUNT_TYPE u, v;
     char *errmsg = NULL;
@@ -1088,9 +1088,9 @@
  */
 static LY_ERR
 ly_type_store_boolean(const struct ly_ctx *ctx, struct lysc_type *type, const char *value, size_t value_len,
-                      int options, LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data),
-                      const void *UNUSED(context_node), const struct lyd_node *UNUSED(tree),
-                      struct lyd_value *storage, struct ly_err_item **err)
+        int options, LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data),
+        const void *UNUSED(context_node), const struct lyd_node *UNUSED(tree),
+        struct lyd_value *storage, struct ly_err_item **err)
 {
     int8_t i;
 
@@ -1131,9 +1131,9 @@
  */
 static LY_ERR
 ly_type_store_empty(const struct ly_ctx *ctx, struct lysc_type *type, const char *value, size_t value_len, int options,
-                    LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data),
-                    const void *UNUSED(context_node), const struct lyd_node *UNUSED(tree),
-                    struct lyd_value *storage, struct ly_err_item **err)
+        LY_PREFIX_FORMAT UNUSED(format), void *UNUSED(prefix_data),
+        const void *UNUSED(context_node), const struct lyd_node *UNUSED(tree),
+        struct lyd_value *storage, struct ly_err_item **err)
 {
     if (options & LY_TYPE_OPTS_SECOND_CALL) {
         return LY_SUCCESS;
@@ -1186,7 +1186,7 @@
 }
 
 static const char *ly_type_print_identityref(const struct lyd_value *value, LY_PREFIX_FORMAT format, void *prefix_data,
-                                             int *dynamic);
+        int *dynamic);
 
 /**
  * @brief Validate, canonize and store value of the YANG built-in identiytref type.
@@ -1195,8 +1195,8 @@
  */
 static LY_ERR
 ly_type_store_identityref(const struct ly_ctx *ctx, struct lysc_type *type, const char *value, size_t value_len, int options,
-                          LY_PREFIX_FORMAT format, void *prefix_data, const void *UNUSED(context_node),
-                          const struct lyd_node *UNUSED(tree),struct lyd_value *storage, struct ly_err_item **err)
+        LY_PREFIX_FORMAT format, void *prefix_data, const void *UNUSED(context_node),
+        const struct lyd_node *UNUSED(tree),struct lyd_value *storage, struct ly_err_item **err)
 {
     struct lysc_type_identityref *type_ident = (struct lysc_type_identityref *)type;
     const char *id_name, *prefix = value;
@@ -1251,7 +1251,7 @@
     } else if (!mod->compiled) {
         /* non-implemented module */
         erc = asprintf(&errmsg, "Invalid identityref \"%.*s\" value - identity found in non-implemented module \"%s\".",
-                 (int)value_len, value, mod->name);
+                        (int)value_len, value, mod->name);
         goto error;
     }
 
@@ -1265,7 +1265,7 @@
     if (u == LY_ARRAY_COUNT(type_ident->bases)) {
         /* no match */
         erc = asprintf(&errmsg, "Invalid identityref \"%.*s\" value - identity not accepted by the type specification.",
-                       (int)value_len, value);
+                        (int)value_len, value);
         goto error;
     }
 
@@ -1325,7 +1325,7 @@
 }
 
 static const char *ly_type_print_instanceid(const struct lyd_value *value, LY_PREFIX_FORMAT format, void *prefix_data,
-                                            int *dynamic);
+        int *dynamic);
 
 /**
  * @brief Validate and store value of the YANG built-in instance-identifier type.
@@ -1334,8 +1334,8 @@
  */
 static LY_ERR
 ly_type_store_instanceid(const struct ly_ctx *ctx, struct lysc_type *type, const char *value, size_t value_len, int options,
-                         LY_PREFIX_FORMAT format, void *prefix_data, const void *context_node, const struct lyd_node *tree,
-                         struct lyd_value *storage, struct ly_err_item **err)
+        LY_PREFIX_FORMAT format, void *prefix_data, const void *context_node, const struct lyd_node *tree,
+        struct lyd_value *storage, struct ly_err_item **err)
 {
     LY_ERR ret = LY_EVALID;
     struct lysc_type_instanceid *type_inst = (struct lysc_type_instanceid *)type;
@@ -1349,7 +1349,7 @@
     /* init */
     *err = NULL;
     ctx_scnode = (options & (LY_TYPE_OPTS_SCHEMA | LY_TYPE_OPTS_INCOMPLETE_DATA)) ?
-                 (struct lysc_node *)context_node : ((struct lyd_node *)context_node)->schema;
+            (struct lysc_node *)context_node : ((struct lyd_node *)context_node)->schema;
 
     if ((options & LY_TYPE_OPTS_SCHEMA) && (options & LY_TYPE_OPTS_INCOMPLETE_DATA)) {
         /* we have incomplete schema tree */
@@ -1542,7 +1542,7 @@
                     break;
                 case LY_PATH_PREDTYPE_POSITION:
                     /* position predicate */
-                    ly_strcat(&result, "[%"PRIu64"]", pred->position);
+                    ly_strcat(&result, "[%" PRIu64 "]", pred->position);
                     break;
                 case LY_PATH_PREDTYPE_LIST:
                 {
@@ -1595,7 +1595,7 @@
                     break;
                 case LY_PATH_PREDTYPE_POSITION:
                     /* position predicate */
-                    ly_strcat(&result, "[%"PRIu64"]", pred->position);
+                    ly_strcat(&result, "[%" PRIu64 "]", pred->position);
                     break;
                 case LY_PATH_PREDTYPE_LIST:
                 {
@@ -1668,7 +1668,7 @@
 
 LY_ERR
 ly_type_find_leafref(const struct lysc_type_leafref *lref, const struct lyd_node *node, struct lyd_value *value,
-                     const struct lyd_node *tree, struct lyd_node **target, char **errmsg)
+        const struct lyd_node *tree, struct lyd_node **target, char **errmsg)
 {
     LY_ERR ret;
     struct lyxp_set set = {0};
@@ -1734,8 +1734,8 @@
  */
 static LY_ERR
 ly_type_store_leafref(const struct ly_ctx *ctx, struct lysc_type *type, const char *value, size_t value_len, int options,
-                      LY_PREFIX_FORMAT format, void *prefix_data, const void *context_node, const struct lyd_node *tree,
-                      struct lyd_value *storage, struct ly_err_item **err)
+        LY_PREFIX_FORMAT format, void *prefix_data, const void *context_node, const struct lyd_node *tree,
+        struct lyd_value *storage, struct ly_err_item **err)
 {
     LY_ERR ret = LY_SUCCESS;
     char *errmsg = NULL;
@@ -1927,7 +1927,7 @@
  */
 static void *
 ly_type_union_store_prefix_data(const struct ly_ctx *ctx, const char *value, size_t value_len, LY_PREFIX_FORMAT format,
-                                void *prefix_data)
+        void *prefix_data)
 {
     unsigned int c;
     const char *start, *stop;
@@ -2063,8 +2063,8 @@
  */
 static LY_ERR
 ly_type_store_union(const struct ly_ctx *ctx, struct lysc_type *type, const char *value, size_t value_len, int options,
-                    LY_PREFIX_FORMAT format, void *prefix_data, const void *context_node, const struct lyd_node *tree,
-                    struct lyd_value *storage, struct ly_err_item **err)
+        LY_PREFIX_FORMAT format, void *prefix_data, const void *context_node, const struct lyd_node *tree,
+        struct lyd_value *storage, struct ly_err_item **err)
 {
     LY_ERR ret = LY_SUCCESS;
     LY_ARRAY_COUNT_TYPE u;
diff --git a/src/plugins_types.h b/src/plugins_types.h
index fdd85c8..8efb320 100644
--- a/src/plugins_types.h
+++ b/src/plugins_types.h
@@ -117,7 +117,7 @@
  * @return NULL otherwise.
  */
 const struct lys_module *ly_resolve_prefix(const struct ly_ctx *ctx, const char *prefix, size_t prefix_len,
-                                           LY_PREFIX_FORMAT format, void *prefix_data);
+        LY_PREFIX_FORMAT format, void *prefix_data);
 
 /**
  * @brief Get format-specific prefix for a module.
@@ -201,8 +201,8 @@
  * @return LY_ERR value if an error occurred and the value could not be canonized following the type's rules.
  */
 typedef LY_ERR (*ly_type_store_clb)(const struct ly_ctx *ctx, struct lysc_type *type, const char *value, size_t value_len,
-                                    int options, LY_PREFIX_FORMAT format, void *prefix_data, const void *context_node,
-                                    const struct lyd_node *tree, struct lyd_value *storage, struct ly_err_item **err);
+        int options, LY_PREFIX_FORMAT format, void *prefix_data, const void *context_node,
+        const struct lyd_node *tree, struct lyd_value *storage, struct ly_err_item **err);
 
 /**
  * @brief Callback for comparing 2 values of the same type.
@@ -234,7 +234,7 @@
  * @return NULL in case of error.
  */
 typedef const char *(*ly_type_print_clb)(const struct lyd_value *value, LY_PREFIX_FORMAT format, void *prefix_data,
-                                         int *dynamic);
+        int *dynamic);
 
 /**
  * @brief Callback to duplicate data in data structure. Note that callback is even responsible for duplicating lyd_value::canonized.
@@ -298,7 +298,7 @@
  * @return LY_ERR value according to the result of the parsing and validation.
  */
 LY_ERR ly_type_parse_int(const char *datatype, int base, int64_t min, int64_t max, const char *value, size_t value_len,
-                 int64_t *ret, struct ly_err_item **err);
+        int64_t *ret, struct ly_err_item **err);
 
 /**
  * @brief Unsigned integer value parser and validator.
@@ -314,7 +314,7 @@
  * @return LY_ERR value according to the result of the parsing and validation.
  */
 LY_ERR ly_type_parse_uint(const char *datatype, int base, uint64_t max, const char *value, size_t value_len,
-                  uint64_t *ret, struct ly_err_item **err);
+        uint64_t *ret, struct ly_err_item **err);
 
 /**
  * @brief Convert a string with a decimal64 value into libyang representation:
@@ -350,7 +350,7 @@
  * @return LY_ERR value according to the result of the validation.
  */
 LY_ERR ly_type_validate_range(LY_DATA_TYPE basetype, struct lysc_range *range, int64_t value, const char *strval,
-                              struct ly_err_item **err);
+        struct ly_err_item **err);
 
 /**
  * @brief Data type validator for pattern-restricted string values.
@@ -378,7 +378,7 @@
  * @return LY_ERR value.
  */
 LY_ERR ly_type_find_leafref(const struct lysc_type_leafref *lref, const struct lyd_node *node, struct lyd_value *value,
-                            const struct lyd_node *tree, struct lyd_node **target, char **errmsg);
+        const struct lyd_node *tree, struct lyd_node **target, char **errmsg);
 
 /** @} types */
 
diff --git a/src/printer.c b/src/printer.c
index 2a42052..099060b 100644
--- a/src/printer.c
+++ b/src/printer.c
@@ -37,38 +37,38 @@
  * @brief informational structure shared by printers
  */
 struct ext_substmt_info_s ext_substmt_info[] = {
-  {NULL, NULL, 0},                              /**< LYEXT_SUBSTMT_SELF */
-  {"argument", "name", SUBST_FLAG_ID},          /**< LYEXT_SUBSTMT_ARGUMENT */
-  {"base", "name", SUBST_FLAG_ID},              /**< LYEXT_SUBSTMT_BASE */
-  {"belongs-to", "module", SUBST_FLAG_ID},      /**< LYEXT_SUBSTMT_BELONGSTO */
-  {"contact", "text", SUBST_FLAG_YIN},          /**< LYEXT_SUBSTMT_CONTACT */
-  {"default", "value", 0},                      /**< LYEXT_SUBSTMT_DEFAULT */
-  {"description", "text", SUBST_FLAG_YIN},      /**< LYEXT_SUBSTMT_DESCRIPTION */
-  {"error-app-tag", "value", 0},                /**< LYEXT_SUBSTMT_ERRTAG */
-  {"error-message", "value", SUBST_FLAG_YIN},   /**< LYEXT_SUBSTMT_ERRMSG */
-  {"key", "value", 0},                          /**< LYEXT_SUBSTMT_KEY */
-  {"namespace", "uri", 0},                      /**< LYEXT_SUBSTMT_NAMESPACE */
-  {"organization", "text", SUBST_FLAG_YIN},     /**< LYEXT_SUBSTMT_ORGANIZATION */
-  {"path", "value", 0},                         /**< LYEXT_SUBSTMT_PATH */
-  {"prefix", "value", SUBST_FLAG_ID},           /**< LYEXT_SUBSTMT_PREFIX */
-  {"presence", "value", 0},                     /**< LYEXT_SUBSTMT_PRESENCE */
-  {"reference", "text", SUBST_FLAG_YIN},        /**< LYEXT_SUBSTMT_REFERENCE */
-  {"revision-date", "date", SUBST_FLAG_ID},     /**< LYEXT_SUBSTMT_REVISIONDATE */
-  {"units", "name", 0},                         /**< LYEXT_SUBSTMT_UNITS */
-  {"value", "value", SUBST_FLAG_ID},            /**< LYEXT_SUBSTMT_VALUE */
-  {"yang-version", "value", SUBST_FLAG_ID},     /**< LYEXT_SUBSTMT_VERSION */
-  {"modifier", "value", SUBST_FLAG_ID},         /**< LYEXT_SUBSTMT_MODIFIER */
-  {"require-instance", "value", SUBST_FLAG_ID}, /**< LYEXT_SUBSTMT_REQINST */
-  {"yin-element", "value", SUBST_FLAG_ID},      /**< LYEXT_SUBSTMT_YINELEM */
-  {"config", "value", SUBST_FLAG_ID},           /**< LYEXT_SUBSTMT_CONFIG */
-  {"mandatory", "value", SUBST_FLAG_ID},        /**< LYEXT_SUBSTMT_MANDATORY */
-  {"ordered-by", "value", SUBST_FLAG_ID},       /**< LYEXT_SUBSTMT_ORDEREDBY */
-  {"status", "value", SUBST_FLAG_ID},           /**< LYEXT_SUBSTMT_STATUS */
-  {"fraction-digits", "value", SUBST_FLAG_ID},  /**< LYEXT_SUBSTMT_DIGITS */
-  {"max-elements", "value", SUBST_FLAG_ID},     /**< LYEXT_SUBSTMT_MAX */
-  {"min-elements", "value", SUBST_FLAG_ID},     /**< LYEXT_SUBSTMT_MIN */
-  {"position", "value", SUBST_FLAG_ID},         /**< LYEXT_SUBSTMT_POSITION */
-  {"unique", "tag", 0},                         /**< LYEXT_SUBSTMT_UNIQUE */
+    {NULL, NULL, 0},                            /**< LYEXT_SUBSTMT_SELF */
+    {"argument", "name", SUBST_FLAG_ID},        /**< LYEXT_SUBSTMT_ARGUMENT */
+    {"base", "name", SUBST_FLAG_ID},            /**< LYEXT_SUBSTMT_BASE */
+    {"belongs-to", "module", SUBST_FLAG_ID},    /**< LYEXT_SUBSTMT_BELONGSTO */
+    {"contact", "text", SUBST_FLAG_YIN},        /**< LYEXT_SUBSTMT_CONTACT */
+    {"default", "value", 0},                    /**< LYEXT_SUBSTMT_DEFAULT */
+    {"description", "text", SUBST_FLAG_YIN},    /**< LYEXT_SUBSTMT_DESCRIPTION */
+    {"error-app-tag", "value", 0},              /**< LYEXT_SUBSTMT_ERRTAG */
+    {"error-message", "value", SUBST_FLAG_YIN}, /**< LYEXT_SUBSTMT_ERRMSG */
+    {"key", "value", 0},                        /**< LYEXT_SUBSTMT_KEY */
+    {"namespace", "uri", 0},                    /**< LYEXT_SUBSTMT_NAMESPACE */
+    {"organization", "text", SUBST_FLAG_YIN},   /**< LYEXT_SUBSTMT_ORGANIZATION */
+    {"path", "value", 0},                       /**< LYEXT_SUBSTMT_PATH */
+    {"prefix", "value", SUBST_FLAG_ID},         /**< LYEXT_SUBSTMT_PREFIX */
+    {"presence", "value", 0},                   /**< LYEXT_SUBSTMT_PRESENCE */
+    {"reference", "text", SUBST_FLAG_YIN},      /**< LYEXT_SUBSTMT_REFERENCE */
+    {"revision-date", "date", SUBST_FLAG_ID},   /**< LYEXT_SUBSTMT_REVISIONDATE */
+    {"units", "name", 0},                       /**< LYEXT_SUBSTMT_UNITS */
+    {"value", "value", SUBST_FLAG_ID},          /**< LYEXT_SUBSTMT_VALUE */
+    {"yang-version", "value", SUBST_FLAG_ID},   /**< LYEXT_SUBSTMT_VERSION */
+    {"modifier", "value", SUBST_FLAG_ID},       /**< LYEXT_SUBSTMT_MODIFIER */
+    {"require-instance", "value", SUBST_FLAG_ID}, /**< LYEXT_SUBSTMT_REQINST */
+    {"yin-element", "value", SUBST_FLAG_ID},    /**< LYEXT_SUBSTMT_YINELEM */
+    {"config", "value", SUBST_FLAG_ID},         /**< LYEXT_SUBSTMT_CONFIG */
+    {"mandatory", "value", SUBST_FLAG_ID},      /**< LYEXT_SUBSTMT_MANDATORY */
+    {"ordered-by", "value", SUBST_FLAG_ID},     /**< LYEXT_SUBSTMT_ORDEREDBY */
+    {"status", "value", SUBST_FLAG_ID},         /**< LYEXT_SUBSTMT_STATUS */
+    {"fraction-digits", "value", SUBST_FLAG_ID}, /**< LYEXT_SUBSTMT_DIGITS */
+    {"max-elements", "value", SUBST_FLAG_ID},   /**< LYEXT_SUBSTMT_MAX */
+    {"min-elements", "value", SUBST_FLAG_ID},   /**< LYEXT_SUBSTMT_MIN */
+    {"position", "value", SUBST_FLAG_ID},       /**< LYEXT_SUBSTMT_POSITION */
+    {"unique", "tag", 0},                       /**< LYEXT_SUBSTMT_UNIQUE */
 };
 
 int
diff --git a/src/printer_data.c b/src/printer_data.c
index 1a6ee95..2fffc57 100644
--- a/src/printer_data.c
+++ b/src/printer_data.c
@@ -145,7 +145,7 @@
 
 API LY_ERR
 lyd_print_clb(ssize_t (*writeclb)(void *arg, const void *buf, size_t count), void *arg,
-              const struct lyd_node *root, LYD_FORMAT format, int options)
+        const struct lyd_node *root, LYD_FORMAT format, int options)
 {
     LY_ERR ret;
     struct ly_out *out;
diff --git a/src/printer_data.h b/src/printer_data.h
index 09fe8f5..3eb4fec 100644
--- a/src/printer_data.h
+++ b/src/printer_data.h
@@ -133,7 +133,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_print_clb(ssize_t (*writeclb)(void *arg, const void *buf, size_t count), void *arg,
-                     const struct lyd_node *root, LYD_FORMAT format, int options);
+        const struct lyd_node *root, LYD_FORMAT format, int options);
 
 #ifdef __cplusplus
 }
diff --git a/src/printer_json.c b/src/printer_json.c
index c0ea3c5..ad9fc3a 100644
--- a/src/printer_json.c
+++ b/src/printer_json.c
@@ -598,7 +598,7 @@
 
     if (!node->schema || node->schema->nodetype != LYS_LIST) {
         ly_print_(ctx->out, "%s{%s", (is_open_array(ctx, node) && ctx->level_printed >= ctx->level) ? "," : "",
-                 (DO_FORMAT && has_content) ? "\n" : "");
+                (DO_FORMAT && has_content) ? "\n" : "");
     } else {
         ly_print_(ctx->out, "%s%*s{%s", (is_open_array(ctx, node) && ctx->level_printed >= ctx->level) ? "," : "",
                  INDENT, (DO_FORMAT && has_content) ? "\n" : "");
@@ -617,7 +617,6 @@
         json_print_anydata(ctx, (struct lyd_node_any *)node);
     }
 
-
     LEVEL_DEC;
     if (DO_FORMAT && has_content) {
         ly_print_(ctx->out, "\n%*s}", INDENT);
diff --git a/src/printer_schema.c b/src/printer_schema.c
index cd283ba..dd31369 100644
--- a/src/printer_schema.c
+++ b/src/printer_schema.c
@@ -26,7 +26,7 @@
 
 API LY_ERR
 lys_print_module(struct ly_out *out, const struct lys_module *module, LYS_OUTFORMAT format, int UNUSED(line_length),
-                 int options)
+        int options)
 {
     LY_ERR ret;
 
@@ -82,7 +82,7 @@
 
 API LY_ERR
 lys_print_submodule(struct ly_out *out, const struct lys_module *module, const struct lysp_submodule *submodule,
-                    LYS_OUTFORMAT format, int UNUSED(line_length), int options)
+        LYS_OUTFORMAT format, int UNUSED(line_length), int options)
 {
     LY_ERR ret;
 
@@ -177,7 +177,7 @@
 
 API LY_ERR
 lys_print_clb(ssize_t (*writeclb)(void *arg, const void *buf, size_t count), void *arg,
-              const struct lys_module *module, LYS_OUTFORMAT format, int options)
+        const struct lys_module *module, LYS_OUTFORMAT format, int options)
 {
     struct ly_out *out;
 
@@ -217,4 +217,3 @@
 
     return ret;
 }
-
diff --git a/src/printer_schema.h b/src/printer_schema.h
index da73248..dbd3082 100644
--- a/src/printer_schema.h
+++ b/src/printer_schema.h
@@ -84,7 +84,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lys_print_submodule(struct ly_out *out, const struct lys_module *module, const struct lysp_submodule *submodule,
-                           LYS_OUTFORMAT format, int line_length, int options);
+        LYS_OUTFORMAT format, int line_length, int options);
 
 /**
  * @brief Print schema tree in the specified format into a memory block.
@@ -157,7 +157,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lys_print_clb(ssize_t (*writeclb)(void *arg, const void *buf, size_t count), void *arg,
-                     const struct lys_module *module, LYS_OUTFORMAT format, int options);
+        const struct lys_module *module, LYS_OUTFORMAT format, int options);
 
 /**
  * @brief Schema node printer.
diff --git a/src/printer_xml.c b/src/printer_xml.c
index 1d949f7..c588963 100644
--- a/src/printer_xml.c
+++ b/src/printer_xml.c
@@ -196,11 +196,11 @@
             ly_print_(out, " %s=\"", meta->name);
         } else {
 #endif
-            /* print the metadata with its namespace */
-            mod = meta->annotation->module;
-            ly_print_(ctx->out, " %s:%s=\"", xml_print_ns(ctx, mod->ns, mod->prefix, 1), meta->name);
+        /* print the metadata with its namespace */
+        mod = meta->annotation->module;
+        ly_print_(ctx->out, " %s:%s=\"", xml_print_ns(ctx, mod->ns, mod->prefix, 1), meta->name);
 #if 0
-        }
+    }
 #endif
 
         /* print metadata value */
@@ -567,4 +567,3 @@
     ly_print_flush(out);
     return LY_SUCCESS;
 }
-
diff --git a/src/printer_yang.c b/src/printer_yang.c
old mode 100755
new mode 100644
index fb806de..a50bd92
--- a/src/printer_yang.c
+++ b/src/printer_yang.c
@@ -219,7 +219,7 @@
  */
 static void
 yprp_extension_instances(struct ypr_ctx *ctx, LYEXT_SUBSTMT substmt, uint8_t substmt_index,
-                               struct lysp_ext_instance *ext, int *flag, LY_ARRAY_COUNT_TYPE count)
+        struct lysp_ext_instance *ext, int *flag, LY_ARRAY_COUNT_TYPE count)
 {
     LY_ARRAY_COUNT_TYPE u;
     struct lysp_stmt *stmt;
@@ -244,7 +244,6 @@
             continue;
         }
 
-
         ypr_open(ctx->out, flag);
         argument = NULL;
         if (ext[u].compiled) {
@@ -286,7 +285,7 @@
  */
 static void
 yprc_extension_instances(struct ypr_ctx *ctx, LYEXT_SUBSTMT substmt, uint8_t substmt_index,
-                                 struct lysc_ext_instance *ext, int *flag, LY_ARRAY_COUNT_TYPE count)
+        struct lysc_ext_instance *ext, int *flag, LY_ARRAY_COUNT_TYPE count)
 {
     LY_ARRAY_COUNT_TYPE u;
 
@@ -322,7 +321,7 @@
         ly_print_(ctx->out, "%*s%s %s", INDENT, ext_substmt_info[substmt].name, text);
     } else {
         ypr_text(ctx, ext_substmt_info[substmt].name, text,
-                 (ext_substmt_info[substmt].flags & SUBST_FLAG_YIN) ? 0 : 1, 0);
+                (ext_substmt_info[substmt].flags & SUBST_FLAG_YIN) ? 0 : 1, 0);
     }
 
     LEVEL++;
@@ -493,7 +492,7 @@
                 brackets_flag = 0;
             }
         }
-        /* falls through */
+    /* falls through */
     case LYS_IFF_OR:
         if (brackets_flag) {
             ly_print_(ctx->out, "(");
@@ -743,15 +742,15 @@
         }
         if (range->parts[u].max_64 == range->parts[u].min_64) {
             if (basetype <= LY_TYPE_STRING) { /* unsigned values */
-                ly_print_(ctx->out, "%"PRIu64, range->parts[u].max_u64);
+                ly_print_(ctx->out, "%" PRIu64, range->parts[u].max_u64);
             } else { /* signed values */
-                ly_print_(ctx->out, "%"PRId64, range->parts[u].max_64);
+                ly_print_(ctx->out, "%" PRId64, range->parts[u].max_64);
             }
         } else {
             if (basetype <= LY_TYPE_STRING) { /* unsigned values */
-                ly_print_(ctx->out, "%"PRIu64"..%"PRIu64, range->parts[u].min_u64, range->parts[u].max_u64);
+                ly_print_(ctx->out, "%" PRIu64 "..%" PRIu64, range->parts[u].min_u64, range->parts[u].max_u64);
             } else { /* signed values */
-                ly_print_(ctx->out, "%"PRId64"..%"PRId64, range->parts[u].min_64, range->parts[u].max_64);
+                ly_print_(ctx->out, "%" PRId64 "..%" PRId64, range->parts[u].min_64, range->parts[u].max_64);
             }
         }
     }
diff --git a/src/printer_yin.c b/src/printer_yin.c
index c718681..24c354e 100644
--- a/src/printer_yin.c
+++ b/src/printer_yin.c
@@ -40,7 +40,7 @@
 };
 
 static void yprp_extension_instances(struct ypr_ctx *ctx, LYEXT_SUBSTMT substmt, uint8_t substmt_index,
-                               struct lysp_ext_instance *ext, int *flag, LY_ARRAY_COUNT_TYPE count);
+        struct lysp_ext_instance *ext, int *flag, LY_ARRAY_COUNT_TYPE count);
 
 static void
 ypr_open(struct ypr_ctx *ctx, const char *elem_name, const char *attr_name, const char *attr_value, int flag)
@@ -1278,8 +1278,7 @@
         if(stmt_attr_info[stmt->kw].flags & SUBST_FLAG_YIN) {
             ypr_open(ctx, stmt->stmt, NULL, NULL, flag);
             ypr_yin_arg(ctx, stmt_attr_info[stmt->kw].arg, stmt->arg);
-        }
-        else {
+        } else {
             ypr_open(ctx, stmt->stmt, stmt_attr_info[stmt->kw].arg, stmt->arg, flag);
         }
     }
@@ -1299,7 +1298,7 @@
  */
 static void
 yprp_extension_instances(struct ypr_ctx *ctx, LYEXT_SUBSTMT substmt, uint8_t substmt_index,
-                               struct lysp_ext_instance *ext, int *flag, LY_ARRAY_COUNT_TYPE count)
+        struct lysp_ext_instance *ext, int *flag, LY_ARRAY_COUNT_TYPE count)
 {
     LY_ARRAY_COUNT_TYPE u;
     char *str;
diff --git a/src/set.c b/src/set.c
index 378a22e..931e4e7 100644
--- a/src/set.c
+++ b/src/set.c
@@ -212,4 +212,3 @@
 
     return ly_set_rm_index(set, i, destructor);
 }
-
diff --git a/src/tree_data.c b/src/tree_data.c
index 6baa2d5..7f2efa2 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -51,11 +51,11 @@
 #include "xpath.h"
 
 static LY_ERR lyd_find_sibling_schema(const struct lyd_node *siblings, const struct lysc_node *schema,
-                                      struct lyd_node **match);
+        struct lyd_node **match);
 
 LY_ERR
 lyd_value_parse(struct lyd_node_term *node, const char *value, size_t value_len, int *dynamic, int second, int value_hint,
-                LY_PREFIX_FORMAT format, void *prefix_data, const struct lyd_node *tree)
+        LY_PREFIX_FORMAT format, void *prefix_data, const struct lyd_node *tree)
 {
     LY_ERR ret = LY_SUCCESS;
     struct ly_err_item *err = NULL;
@@ -92,7 +92,7 @@
 /* similar to lyd_value_parse except can be used just to store the value, hence also does not support a second call */
 LY_ERR
 lyd_value_store(struct lyd_value *val, const struct lysc_node *schema, const char *value, size_t value_len, int *dynamic,
-                LY_PREFIX_FORMAT format, void *prefix_data)
+        LY_PREFIX_FORMAT format, void *prefix_data)
 {
     LY_ERR ret = LY_SUCCESS;
     struct ly_err_item *err = NULL;
@@ -123,8 +123,8 @@
 
 LY_ERR
 lyd_value_parse_meta(const struct ly_ctx *ctx, struct lyd_meta *meta, const char *value, size_t value_len, int *dynamic,
-                     int second, int value_hint, LY_PREFIX_FORMAT format, void *prefix_data, const struct lysc_node *ctx_snode,
-                     const struct lyd_node *tree)
+        int second, int value_hint, LY_PREFIX_FORMAT format, void *prefix_data, const struct lysc_node *ctx_snode,
+        const struct lyd_node *tree)
 {
     LY_ERR ret = LY_SUCCESS;
     struct ly_err_item *err = NULL;
@@ -154,7 +154,7 @@
 
 LY_ERR
 _lys_value_validate(const struct ly_ctx *ctx, const struct lysc_node *node, const char *value, size_t value_len,
-                    LY_PREFIX_FORMAT format, void *prefix_data)
+        LY_PREFIX_FORMAT format, void *prefix_data)
 {
     LY_ERR rc = LY_SUCCESS;
     struct ly_err_item *err = NULL;
@@ -199,7 +199,7 @@
 
 API LY_ERR
 lyd_value_validate(const struct ly_ctx *ctx, const struct lyd_node_term *node, const char *value, size_t value_len,
-                   const struct lyd_node *tree, struct lysc_type **realtype)
+        const struct lyd_node *tree, struct lysc_type **realtype)
 {
     LY_ERR rc;
     struct ly_err_item *err = NULL;
@@ -299,7 +299,7 @@
 
 API LY_ERR
 lyd_parse_data(const struct ly_ctx *ctx, struct ly_in *in, LYD_FORMAT format, int parse_options, int validate_options,
-               struct lyd_node **tree)
+        struct lyd_node **tree)
 {
     LY_ERR ret = LY_SUCCESS;
     struct lyd_ctx *lydctx = NULL;
@@ -358,7 +358,7 @@
 
             /* add all top-level defaults for this module */
             ret = lyd_new_implicit_r(NULL, first2, NULL, mod, &lydctx->unres_node_type, &lydctx->when_check,
-                                     (validate_options & LYD_VALIDATE_NO_STATE) ? LYD_IMPLICIT_NO_STATE : 0, NULL);
+                            (validate_options & LYD_VALIDATE_NO_STATE) ? LYD_IMPLICIT_NO_STATE : 0, NULL);
             LY_CHECK_GOTO(ret, cleanup);
 
             /* finish incompletely validated terminal values/attributes and when conditions */
@@ -393,7 +393,7 @@
 
 API LY_ERR
 lyd_parse_data_mem(const struct ly_ctx *ctx, const char *data, LYD_FORMAT format, int parse_options, int validate_options,
-                   struct lyd_node **tree)
+        struct lyd_node **tree)
 {
     LY_ERR ret;
     struct ly_in *in;
@@ -407,7 +407,7 @@
 
 API LY_ERR
 lyd_parse_data_fd(const struct ly_ctx *ctx, int fd, LYD_FORMAT format, int parse_options, int validate_options,
-                  struct lyd_node **tree)
+        struct lyd_node **tree)
 {
     LY_ERR ret;
     struct ly_in *in;
@@ -421,7 +421,7 @@
 
 API LY_ERR
 lyd_parse_data_path(const struct ly_ctx *ctx, const char *path, LYD_FORMAT format, int parse_options,
-                    int validate_options, struct lyd_node **tree)
+        int validate_options, struct lyd_node **tree)
 {
     LY_ERR ret;
     struct ly_in *in;
@@ -466,7 +466,7 @@
 
 API LY_ERR
 lyd_parse_reply(const struct lyd_node *request, struct ly_in *in, LYD_FORMAT format, struct lyd_node **tree,
-                struct lyd_node **op)
+        struct lyd_node **op)
 {
     LY_CHECK_ARG_RET(NULL, request, LY_EINVAL);
     LY_CHECK_ARG_RET(LYD_CTX(request), in, tree || op, LY_EINVAL);
@@ -534,7 +534,7 @@
 
 LY_ERR
 lyd_create_term(const struct lysc_node *schema, const char *value, size_t value_len, int *dynamic, int value_hint,
-                LY_PREFIX_FORMAT format, void *prefix_data, struct lyd_node **node)
+        LY_PREFIX_FORMAT format, void *prefix_data, struct lyd_node **node)
 {
     LY_ERR ret;
     struct lyd_node_term *term;
@@ -693,8 +693,8 @@
 
 LY_ERR
 lyd_create_opaq(const struct ly_ctx *ctx, const char *name, size_t name_len, const char *value, size_t value_len,
-                int *dynamic, int value_hint, LYD_FORMAT format, struct ly_prefix *val_prefs, const char *prefix, size_t pref_len,
-                const char *module_key, size_t module_key_len, struct lyd_node **node)
+        int *dynamic, int value_hint, LYD_FORMAT format, struct ly_prefix *val_prefs, const char *prefix, size_t pref_len,
+        const char *module_key, size_t module_key_len, struct lyd_node **node)
 {
     struct lyd_node_opaq *opaq;
 
@@ -811,7 +811,7 @@
 
 API LY_ERR
 lyd_new_list2(struct lyd_node *parent, const struct lys_module *module, const char *name, const char *keys,
-              struct lyd_node **node)
+        struct lyd_node **node)
 {
     struct lyd_node *ret = NULL;
     const struct lysc_node *schema;
@@ -849,7 +849,7 @@
 
 API LY_ERR
 lyd_new_term(struct lyd_node *parent, const struct lys_module *module, const char *name, const char *val_str,
-             struct lyd_node **node)
+        struct lyd_node **node)
 {
     LY_ERR rc;
     struct lyd_node *ret = NULL;
@@ -879,7 +879,7 @@
 
 API LY_ERR
 lyd_new_any(struct lyd_node *parent, const struct lys_module *module, const char *name, const void *value,
-            LYD_ANYDATA_VALUETYPE value_type, struct lyd_node **node)
+        LYD_ANYDATA_VALUETYPE value_type, struct lyd_node **node)
 {
     struct lyd_node *ret = NULL;
     const struct lysc_node *schema;
@@ -917,7 +917,7 @@
  */
 static LY_ERR
 lyd_new_path_update(struct lyd_node *node, const void *value, LYD_ANYDATA_VALUETYPE value_type,
-                    struct lyd_node **new_parent, struct lyd_node **new_node)
+        struct lyd_node **new_parent, struct lyd_node **new_node)
 {
     LY_ERR ret = LY_SUCCESS;
     struct lyd_node *new_any;
@@ -980,7 +980,7 @@
 
 API LY_ERR
 lyd_new_meta(struct lyd_node *parent, const struct lys_module *module, const char *name, const char *val_str,
-             struct lyd_meta **meta)
+        struct lyd_meta **meta)
 {
     struct lyd_meta *ret = NULL;
     const struct ly_ctx *ctx;
@@ -1020,7 +1020,7 @@
 
 API LY_ERR
 lyd_new_opaq(struct lyd_node *parent, const struct ly_ctx *ctx, const char *name, const char *value,
-             const char *module_name, struct lyd_node **node)
+        const char *module_name, struct lyd_node **node)
 {
     struct lyd_node *ret = NULL;
 
@@ -1047,7 +1047,7 @@
 
 API LY_ERR
 lyd_new_attr(struct lyd_node *parent, const char *module_name, const char *name, const char *val_str,
-             struct lyd_attr **attr)
+        struct lyd_attr **attr)
 {
     struct lyd_attr *ret = NULL;
     const struct ly_ctx *ctx;
@@ -1198,14 +1198,14 @@
 
 API LY_ERR
 lyd_new_path(struct lyd_node *parent, const struct ly_ctx *ctx, const char *path, const char *value, int options,
-             struct lyd_node **node)
+        struct lyd_node **node)
 {
     return lyd_new_path2(parent, ctx, path, value, 0, options, node, NULL);
 }
 
 API LY_ERR
 lyd_new_path2(struct lyd_node *parent, const struct ly_ctx *ctx, const char *path, const void *value,
-              LYD_ANYDATA_VALUETYPE value_type, int options, struct lyd_node **new_parent, struct lyd_node **new_node)
+        LYD_ANYDATA_VALUETYPE value_type, int options, struct lyd_node **new_parent, struct lyd_node **new_node)
 {
     LY_ERR ret = LY_SUCCESS, r;
     struct lyxp_expr *exp = NULL;
@@ -1302,7 +1302,7 @@
                 }
                 break;
             }
-            /* fallthrough */
+        /* fallthrough */
         case LYS_CONTAINER:
         case LYS_NOTIF:
         case LYS_RPC:
@@ -1381,8 +1381,8 @@
 
 LY_ERR
 lyd_new_implicit_r(struct lyd_node *parent, struct lyd_node **first, const struct lysc_node *sparent,
-                   const struct lys_module *mod, struct ly_set *node_types, struct ly_set *node_when, int impl_opts,
-                   struct lyd_node **diff)
+        const struct lys_module *mod, struct ly_set *node_types, struct ly_set *node_when, int impl_opts,
+        struct lyd_node **diff)
 {
     LY_ERR ret;
     const struct lysc_node *iter = NULL;
@@ -2118,8 +2118,8 @@
 
 LY_ERR
 lyd_create_meta(struct lyd_node *parent, struct lyd_meta **meta, const struct lys_module *mod, const char *name,
-                size_t name_len, const char *value, size_t value_len, int *dynamic, int value_hint, LY_PREFIX_FORMAT format,
-                void *prefix_data, const struct lysc_node *ctx_snode)
+        size_t name_len, const char *value, size_t value_len, int *dynamic, int value_hint, LY_PREFIX_FORMAT format,
+        void *prefix_data, const struct lysc_node *ctx_snode)
 {
     LY_ERR ret;
     struct lysc_ext_instance *ant = NULL;
@@ -2196,8 +2196,8 @@
 
 LY_ERR
 lyd_create_attr(struct lyd_node *parent, struct lyd_attr **attr, const struct ly_ctx *ctx, const char *name,
-                size_t name_len, const char *value, size_t value_len, int *dynamic, int value_hint, LYD_FORMAT format,
-                struct ly_prefix *val_prefs, const char *prefix, size_t prefix_len, const char *module_key, size_t module_key_len)
+        size_t name_len, const char *value, size_t value_len, int *dynamic, int value_hint, LYD_FORMAT format,
+        struct ly_prefix *val_prefs, const char *prefix, size_t prefix_len, const char *module_key, size_t module_key_len)
 {
     struct lyd_attr *at, *last;
 
@@ -2373,7 +2373,7 @@
             } else {
                 /* lists without keys, their equivalence is based on equivalence of all the children (both direct and indirect) */
 
-    all_children_compare:
+all_children_compare:
                 if (!iter1 && !iter2) {
                     /* no children, nothing to compare */
                     return LY_SUCCESS;
@@ -2475,7 +2475,7 @@
  */
 static LY_ERR
 lyd_dup_r(const struct lyd_node *node, struct lyd_node *parent, struct lyd_node **first, int options,
-          struct lyd_node **dup_p)
+        struct lyd_node **dup_p)
 {
     LY_ERR ret;
     struct lyd_node *dup = NULL;
@@ -2611,7 +2611,7 @@
 
 static LY_ERR
 lyd_dup_get_local_parent(const struct lyd_node *node, const struct lyd_node_inner *parent, struct lyd_node **dup_parent,
-                         struct lyd_node_inner **local_parent)
+        struct lyd_node_inner **local_parent)
 {
     const struct lyd_node_inner *orig_parent, *iter;
     int repeat = 1;
@@ -2627,7 +2627,7 @@
         } else {
             iter = NULL;
             LY_CHECK_RET(lyd_dup_r((struct lyd_node *)orig_parent, NULL, (struct lyd_node **)&iter, 0,
-                                   (struct lyd_node **)&iter));
+                    (struct lyd_node **)&iter));
         }
         if (!*local_parent) {
             *local_parent = (struct lyd_node_inner *)iter;
@@ -2759,7 +2759,7 @@
  */
 static LY_ERR
 lyd_merge_sibling_r(struct lyd_node **first_trg, struct lyd_node *parent_trg, const struct lyd_node **sibling_src_p,
-                    int options)
+        int options)
 {
     LY_ERR ret;
     const struct lyd_node *child_src, *tmp, *sibling_src;
@@ -2794,7 +2794,7 @@
         } else if ((match_trg->schema->nodetype & LYS_ANYDATA) && lyd_compare_single(sibling_src, match_trg, 0)) {
             /* update value */
             LY_CHECK_RET(lyd_any_copy_value(match_trg, &((struct lyd_node_any *)sibling_src)->value,
-                                            ((struct lyd_node_any *)sibling_src)->value_type));
+                    ((struct lyd_node_any *)sibling_src)->value_type));
 
             /* copy flags and add LYD_NEW */
             match_trg->flags = sibling_src->flags | LYD_NEW;
@@ -3272,7 +3272,7 @@
 
 API LY_ERR
 lyd_find_sibling_val(const struct lyd_node *siblings, const struct lysc_node *schema, const char *key_or_value,
-                     size_t val_len, struct lyd_node **match)
+        size_t val_len, struct lyd_node **match)
 {
     LY_ERR rc;
     struct lyd_node *target = NULL;
diff --git a/src/tree_data.h b/src/tree_data.h
index 809a1c9..c72ce2e 100644
--- a/src/tree_data.h
+++ b/src/tree_data.h
@@ -559,7 +559,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_new_list2(struct lyd_node *parent, const struct lys_module *module, const char *name, const char *keys,
-                     struct lyd_node **node);
+        struct lyd_node **node);
 
 /**
  * @brief Create a new term node in the data tree.
@@ -573,7 +573,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_new_term(struct lyd_node *parent, const struct lys_module *module, const char *name, const char *val_str,
-                    struct lyd_node **node);
+        struct lyd_node **node);
 
 /**
  * @brief Create a new any node in the data tree.
@@ -587,7 +587,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_new_any(struct lyd_node *parent, const struct lys_module *module, const char *name, const void *value,
-                   LYD_ANYDATA_VALUETYPE value_type, struct lyd_node **node);
+        LYD_ANYDATA_VALUETYPE value_type, struct lyd_node **node);
 
 /**
  * @brief Create new metadata for a data node.
@@ -602,7 +602,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_new_meta(struct lyd_node *parent, const struct lys_module *module, const char *name, const char *val_str,
-                    struct lyd_meta **meta);
+        struct lyd_meta **meta);
 
 /**
  * @brief Create a new opaque node in the data tree.
@@ -616,7 +616,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_new_opaq(struct lyd_node *parent, const struct ly_ctx *ctx, const char *name, const char *value,
-                    const char *module_name, struct lyd_node **node);
+        const char *module_name, struct lyd_node **node);
 
 /**
  * @brief Create new attribute for an opaque data node.
@@ -629,7 +629,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_new_attr(struct lyd_node *parent, const char *module_name, const char *name, const char *val_str,
-                    struct lyd_attr **attr);
+        struct lyd_attr **attr);
 
 /**
  * @defgroup pathoptions Data path creation options
@@ -673,7 +673,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_new_path(struct lyd_node *parent, const struct ly_ctx *ctx, const char *path, const char *value,
-                    int options, struct lyd_node **node);
+        int options, struct lyd_node **node);
 
 /**
  * @brief Create a new node in the data tree based on a path. All node types can be created.
@@ -692,7 +692,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_new_path_any(struct lyd_node *parent, const struct ly_ctx *ctx, const char *path, const void *value,
-                        LYD_ANYDATA_VALUETYPE value_type, int options, struct lyd_node **node);
+        LYD_ANYDATA_VALUETYPE value_type, int options, struct lyd_node **node);
 
 /**
  * @brief Create a new node in the data tree based on a path. All node types can be created.
@@ -712,7 +712,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_new_path2(struct lyd_node *parent, const struct ly_ctx *ctx, const char *path, const void *value,
-                     LYD_ANYDATA_VALUETYPE value_type, int options, struct lyd_node **new_parent, struct lyd_node **new_node);
+        LYD_ANYDATA_VALUETYPE value_type, int options, struct lyd_node **new_parent, struct lyd_node **new_node);
 
 /**
  * @defgroup implicitoptions Implicit node creation options
@@ -764,7 +764,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_new_implicit_module(struct lyd_node **tree, const struct lys_module *module, int implicit_options,
-                               struct lyd_node **diff);
+        struct lyd_node **diff);
 
 /**
  * @brief Change the value of a term (leaf or leaf-list) node.
@@ -925,7 +925,7 @@
  * @return LY_ERR value if an error occurred.
  */
 LY_ERR lyd_value_validate(const struct ly_ctx *ctx, const struct lyd_node_term *node, const char *value, size_t value_len,
-                          const struct lyd_node *tree, struct lysc_type **realtype);
+        const struct lyd_node *tree, struct lysc_type **realtype);
 
 /**
  * @brief Compare the node's value with the given string value. The string value is first validated according to the node's type.
@@ -1172,7 +1172,7 @@
  * @return LY_ERR on error.
  */
 LY_ERR lyd_diff_apply_module(struct lyd_node **data, const struct lyd_node *diff, const struct lys_module *mod,
-                             lyd_diff_cb diff_cb, void *cb_data);
+        lyd_diff_cb diff_cb, void *cb_data);
 
 /**
  * @brief Apply the whole diff tree on a data tree.
@@ -1206,7 +1206,7 @@
  * @return LY_ERR on error.
  */
 LY_ERR lyd_diff_merge_module(struct lyd_node **diff, const struct lyd_node *src_diff, const struct lys_module *mod,
-                             lyd_diff_cb diff_cb, void *cb_data);
+        lyd_diff_cb diff_cb, void *cb_data);
 
 /**
  * @brief Merge 2 diff trees into each other.
@@ -1220,7 +1220,7 @@
  * @return LY_ERR on error.
  */
 LY_ERR lyd_diff_merge_tree(struct lyd_node **diff_first, struct lyd_node *diff_parent, const struct lyd_node *src_sibling,
-                           lyd_diff_cb diff_cb, void *cb_data);
+        lyd_diff_cb diff_cb, void *cb_data);
 
 /**
  * @brief Merge 2 diffs into each other.
@@ -1323,7 +1323,7 @@
  * @return LY_ERR value if another error occurred.
  */
 LY_ERR lyd_find_sibling_val(const struct lyd_node *siblings, const struct lysc_node *schema, const char *key_or_value,
-                            size_t val_len, struct lyd_node **match);
+        size_t val_len, struct lyd_node **match);
 
 /**
  * @brief Search in the given data for instances of nodes matching the provided XPath.
diff --git a/src/tree_data_free.c b/src/tree_data_free.c
index bb6231c..305cb69 100644
--- a/src/tree_data_free.c
+++ b/src/tree_data_free.c
@@ -12,7 +12,6 @@
  *     https://opensource.org/licenses/BSD-3-Clause
  */
 
-
 #include <assert.h>
 #include <stdlib.h>
 
diff --git a/src/tree_data_helpers.c b/src/tree_data_helpers.c
index b113140..faf1263 100644
--- a/src/tree_data_helpers.c
+++ b/src/tree_data_helpers.c
@@ -31,7 +31,7 @@
 
 struct lyd_node *
 lys_getnext_data(const struct lyd_node *last, const struct lyd_node *sibling, const struct lysc_node **slast,
-                 const struct lysc_node *parent, const struct lysc_module *module)
+        const struct lysc_node *parent, const struct lysc_module *module)
 {
     const struct lysc_node *siter = NULL;
     struct lyd_node *match = NULL;
@@ -120,7 +120,7 @@
 
 const struct lys_module *
 lyd_mod_next_module(struct lyd_node *tree, const struct lys_module *module, const struct ly_ctx *ctx, uint32_t *i,
-                    struct lyd_node **first)
+        struct lyd_node **first)
 {
     struct lyd_node *iter;
     const struct lys_module *mod;
diff --git a/src/tree_data_internal.h b/src/tree_data_internal.h
index 290f40a..f7c0540 100644
--- a/src/tree_data_internal.h
+++ b/src/tree_data_internal.h
@@ -82,8 +82,8 @@
  * @return NULL if last data node was already returned.
  */
 struct lyd_node *lys_getnext_data(const struct lyd_node *last, const struct lyd_node *sibling,
-                                  const struct lysc_node **slast, const struct lysc_node *parent,
-                                  const struct lysc_module *module);
+        const struct lysc_node **slast, const struct lysc_node *parent,
+        const struct lysc_module *module);
 
 /**
  * @brief Create a term (leaf/leaf-list) node from a string value.
@@ -103,7 +103,7 @@
  * @return LY_ERR value if an error occurred.
  */
 LY_ERR lyd_create_term(const struct lysc_node *schema, const char *value, size_t value_len, int *dynamic, int value_hint,
-                       LY_PREFIX_FORMAT format, void *prefix_data, struct lyd_node **node);
+        LY_PREFIX_FORMAT format, void *prefix_data, struct lyd_node **node);
 
 /**
  * @brief Create a term (leaf/leaf-list) node from a parsed value by duplicating it.
@@ -158,7 +158,7 @@
  * @return LY_ERR value if an error occurred.
  */
 LY_ERR lyd_create_any(const struct lysc_node *schema, const void *value, LYD_ANYDATA_VALUETYPE value_type,
-                      struct lyd_node **node);
+        struct lyd_node **node);
 
 /**
  * @brief Create an opaque node.
@@ -181,8 +181,8 @@
  * @return LY_ERR value if an error occurred.
  */
 LY_ERR lyd_create_opaq(const struct ly_ctx *ctx, const char *name, size_t name_len, const char *value, size_t value_len,
-                       int *dynamic, int value_hint, LYD_FORMAT format, struct ly_prefix *val_prefs, const char *prefix,
-                       size_t pref_len, const char *module_key, size_t module_key_len, struct lyd_node **node);
+        int *dynamic, int value_hint, LYD_FORMAT format, struct ly_prefix *val_prefs, const char *prefix,
+        size_t pref_len, const char *module_key, size_t module_key_len, struct lyd_node **node);
 
 /**
  * @brief Check the existence and create any non-existing implicit siblings, recursively for the created nodes.
@@ -198,8 +198,8 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_new_implicit_r(struct lyd_node *parent, struct lyd_node **first, const struct lysc_node *sparent,
-                          const struct lys_module *mod, struct ly_set *node_types, struct ly_set *node_when,
-                          int impl_opts, struct lyd_node **diff);
+        const struct lys_module *mod, struct ly_set *node_types, struct ly_set *node_when,
+        int impl_opts, struct lyd_node **diff);
 
 /**
  * @brief Find the next node, before which to insert the new node.
@@ -248,8 +248,8 @@
  * @return LY_ERR value if an error occurred.
  */
 LY_ERR lyd_create_meta(struct lyd_node *parent, struct lyd_meta **meta, const struct lys_module *mod, const char *name,
-                       size_t name_len, const char *value, size_t value_len, int *dynamic, int value_hint,
-                       LY_PREFIX_FORMAT format, void *prefix_data, const struct lysc_node *ctx_snode);
+        size_t name_len, const char *value, size_t value_len, int *dynamic, int value_hint,
+        LY_PREFIX_FORMAT format, void *prefix_data, const struct lysc_node *ctx_snode);
 
 /**
  * @brief Insert an attribute (last) into a parent
@@ -281,8 +281,8 @@
  * @return LY_ERR value if an error occurred.
  */
 LY_ERR lyd_create_attr(struct lyd_node *parent, struct lyd_attr **attr, const struct ly_ctx *ctx, const char *name,
-                       size_t name_len, const char *value, size_t value_len, int *dynamic, int value_hint, LYD_FORMAT format,
-                       struct ly_prefix *val_prefs, const char *prefix, size_t prefix_len, const char *module_key, size_t module_key_len);
+        size_t name_len, const char *value, size_t value_len, int *dynamic, int value_hint, LYD_FORMAT format,
+        struct ly_prefix *val_prefs, const char *prefix, size_t prefix_len, const char *module_key, size_t module_key_len);
 
 /**
  * @defgroup lydvalueparseopts Hint options for type plugin callbacks from the data parsers.
@@ -316,11 +316,11 @@
  * @return LY_ERR value if an error occurred.
  */
 LY_ERR lyd_value_parse(struct lyd_node_term *node, const char *value, size_t value_len, int *dynamic, int second, int value_hint,
-                       LY_PREFIX_FORMAT format, void *prefix_data, const struct lyd_node *tree);
+        LY_PREFIX_FORMAT format, void *prefix_data, const struct lyd_node *tree);
 
 /* similar to lyd_value_parse except can be used just to store the value, hence does also not support a second call */
 LY_ERR lyd_value_store(struct lyd_value *val, const struct lysc_node *schema, const char *value, size_t value_len,
-                       int *dynamic, LY_PREFIX_FORMAT format, void *prefix_data);
+        int *dynamic, LY_PREFIX_FORMAT format, void *prefix_data);
 
 /**
  * @brief Validate, canonize and store the given @p value into the metadata according to the annotation type's rules.
@@ -343,12 +343,12 @@
  * @return LY_ERR value if an error occurred.
  */
 LY_ERR lyd_value_parse_meta(const struct ly_ctx *ctx, struct lyd_meta *meta, const char *value, size_t value_len,
-                            int *dynamic, int second, int value_hint, LY_PREFIX_FORMAT format, void *prefix_data,
-                            const struct lysc_node *ctx_snode, const struct lyd_node *tree);
+        int *dynamic, int second, int value_hint, LY_PREFIX_FORMAT format, void *prefix_data,
+        const struct lysc_node *ctx_snode, const struct lyd_node *tree);
 
 /* generic function lys_value_validate */
 LY_ERR _lys_value_validate(const struct ly_ctx *ctx, const struct lysc_node *node, const char *value, size_t value_len,
-                           LY_PREFIX_FORMAT format, void *prefix_data);
+        LY_PREFIX_FORMAT format, void *prefix_data);
 
 /**
  * @brief Parse XML string as YANG data tree.
@@ -362,7 +362,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_parse_xml_data(const struct ly_ctx *ctx, struct ly_in *in, int parse_options, int validate_options,
-                          struct lyd_node **tree_p, struct lyd_ctx **lydctx_p);
+        struct lyd_node **tree_p, struct lyd_ctx **lydctx_p);
 
 /**
  * @brief Parse XML string as YANG RPC/action invocation.
@@ -419,7 +419,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_parse_json_data(const struct ly_ctx *ctx, struct ly_in *in, int parse_options, int validate_options,
-                           struct lyd_node **tree_p, struct lyd_ctx **lydctx_p);
+        struct lyd_node **tree_p, struct lyd_ctx **lydctx_p);
 
 /**
  * @brief Parse JSON string as YANG notification.
@@ -475,7 +475,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_parse_lyb_data(const struct ly_ctx *ctx, struct ly_in *in, int parse_options, int validate_options,
-                          struct lyd_node **tree_p, struct lyd_ctx **lydctx_p);
+        struct lyd_node **tree_p, struct lyd_ctx **lydctx_p);
 
 /**
  * @brief Parse binary data as YANG RPC/action invocation.
@@ -554,7 +554,7 @@
  * @return NULL if all modules were traversed.
  */
 const struct lys_module *lyd_mod_next_module(struct lyd_node *tree, const struct lys_module *module,
-                                             const struct ly_ctx *ctx, uint32_t *i, struct lyd_node **first);
+        const struct ly_ctx *ctx, uint32_t *i, struct lyd_node **first);
 
 /**
  * @brief Iterate over modules for functions that want to traverse all the top-level data.
diff --git a/src/tree_schema.c b/src/tree_schema.c
index 92c124b..66eb3ab 100644
--- a/src/tree_schema.c
+++ b/src/tree_schema.c
@@ -259,7 +259,7 @@
 
 API const struct lysc_node *
 lys_find_child(const struct lysc_node *parent, const struct lys_module *module, const char *name, size_t name_len,
-               uint16_t nodetype, int options)
+        uint16_t nodetype, int options)
 {
     const struct lysc_node *node = NULL;
 
@@ -379,7 +379,7 @@
 
 char *
 lysc_path_until(const struct lysc_node *node, const struct lysc_node *parent, LYSC_PATH_TYPE pathtype, char *buffer,
-                size_t buflen)
+        size_t buflen)
 {
     const struct lysc_node *iter;
     char *path = NULL;
@@ -877,8 +877,8 @@
 
 LY_ERR
 lys_parse_mem_submodule(struct ly_ctx *ctx, struct ly_in *in, LYS_INFORMAT format, struct lys_parser_ctx *main_ctx,
-                        LY_ERR (*custom_check)(const struct ly_ctx*, struct lysp_module*, struct lysp_submodule*, void*),
-                        void *check_data, struct lysp_submodule **submodule)
+        LY_ERR (*custom_check)(const struct ly_ctx*, struct lysp_module*, struct lysp_submodule*, void*),
+        void *check_data, struct lysp_submodule **submodule)
 {
     LY_ERR ret;
     struct lysp_submodule *submod = NULL, *latest_sp;
@@ -963,9 +963,9 @@
 
 LY_ERR
 lys_parse_mem_module(struct ly_ctx *ctx, struct ly_in *in, LYS_INFORMAT format, int implement,
-                     LY_ERR (*custom_check)(const struct ly_ctx *ctx, struct lysp_module *mod,
+        LY_ERR (*custom_check)(const struct ly_ctx *ctx, struct lysp_module *mod,
                                             struct lysp_submodule *submod, void *data), void *check_data,
-                     struct lys_module **module)
+        struct lys_module **module)
 {
     struct lys_module *mod = NULL, *latest, *mod_dup;
     LY_ERR ret;
@@ -1183,7 +1183,7 @@
 API LY_ERR
 lys_parse_mem(struct ly_ctx *ctx, const char *data, LYS_INFORMAT format, const struct lys_module **module)
 {
-	LY_ERR ret;
+    LY_ERR ret;
     struct ly_in *in = NULL;
 
     LY_CHECK_ARG_RET(ctx, data, format != LYS_IN_UNKNOWN, LY_EINVAL);
@@ -1199,7 +1199,7 @@
 API LY_ERR
 lys_parse_fd(struct ly_ctx *ctx, int fd, LYS_INFORMAT format, const struct lys_module **module)
 {
-	LY_ERR ret;
+    LY_ERR ret;
     struct ly_in *in = NULL;
 
     LY_CHECK_ARG_RET(ctx, fd > -1, format != LYS_IN_UNKNOWN, LY_EINVAL);
@@ -1215,7 +1215,7 @@
 API LY_ERR
 lys_parse_path(struct ly_ctx *ctx, const char *path, LYS_INFORMAT format, const struct lys_module **module)
 {
-	LY_ERR ret;
+    LY_ERR ret;
     struct ly_in *in = NULL;
 
     LY_CHECK_ARG_RET(ctx, path, format != LYS_IN_UNKNOWN, LY_EINVAL);
@@ -1231,7 +1231,7 @@
 
 API LY_ERR
 lys_search_localfile(const char * const *searchpaths, int cwd, const char *name, const char *revision,
-                     char **localfile, LYS_INFORMAT *format)
+        char **localfile, LYS_INFORMAT *format)
 {
     size_t len, flen, match_len = 0, dir_len;
     int i, implicit_cwd = 0, ret = EXIT_FAILURE;
@@ -1344,10 +1344,10 @@
                 flen = strlen(file->d_name);
                 if (!strcmp(&file->d_name[flen - 5], ".yang")) {
                     format_aux = LYS_IN_YANG;
-                /* TODO YIN parser
-                } else if (!strcmp(&file->d_name[flen - 4], ".yin")) {
-                    format_aux = LYS_IN_YIN;
-                */
+                    /* TODO YIN parser
+                    } else if (!strcmp(&file->d_name[flen - 4], ".yin")) {
+                        format_aux = LYS_IN_YIN;
+                    */
                 } else {
                     /* not supportde suffix/file format */
                     continue;
@@ -1420,4 +1420,3 @@
 
     return ret;
 }
-
diff --git a/src/tree_schema.h b/src/tree_schema.h
index 38dedf1..8837bce 100644
--- a/src/tree_schema.h
+++ b/src/tree_schema.h
@@ -1055,7 +1055,7 @@
     struct lysp_deviation *deviations; /**< list of deviations ([sized array](@ref sizedarrays)) */
     struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */
 
-    uint8_t parsing:1;               /**< flag for circular check */
+    uint8_t parsing : 1;               /**< flag for circular check */
 };
 
 struct lysp_submodule {
@@ -1077,9 +1077,9 @@
     struct lysp_deviation *deviations; /**< list of deviations ([sized array](@ref sizedarrays)) */
     struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */
 
-    uint8_t parsing:1;               /**< flag for circular check */
+    uint8_t parsing : 1;               /**< flag for circular check */
 
-    uint8_t latest_revision:2;       /**< flag to mark the latest available revision:
+    uint8_t latest_revision : 2;       /**< flag to mark the latest available revision:
                                           1 - the latest revision in searchdirs was not searched yet and this is the
                                           latest revision in the current context
                                           2 - searchdirs were searched and this is the latest available revision */
@@ -1245,8 +1245,8 @@
     const char *emsg;                /**< error-message */
     const char *eapptag;             /**< error-app-tag value */
     struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */
-    uint32_t inverted:1;             /**< invert-match flag */
-    uint32_t refcount:31;            /**< reference counter */
+    uint32_t inverted : 1;             /**< invert-match flag */
+    uint32_t refcount : 31;            /**< reference counter */
 };
 
 struct lysc_must {
@@ -1945,7 +1945,7 @@
  * @return Next schema tree node that can be instantiated in a data tree, NULL in case there is no such element.
  */
 const struct lysc_node *lys_getnext(const struct lysc_node *last, const struct lysc_node *parent,
-                                    const struct lysc_module *module, int options);
+        const struct lysc_module *module, int options);
 
 /**
  * @defgroup sgetnextflags lys_getnext() flags
@@ -1974,7 +1974,7 @@
  * @return Found node if any.
  */
 const struct lysc_node *lys_find_child(const struct lysc_node *parent, const struct lys_module *module,
-                                       const char *name, size_t name_len, uint16_t nodetype, int options);
+        const char *name, size_t name_len, uint16_t nodetype, int options);
 
 /**
  * @brief Get schema node specified by the schema path.
diff --git a/src/tree_schema_compile.c b/src/tree_schema_compile.c
index 5541dd5..73f688d 100644
--- a/src/tree_schema_compile.c
+++ b/src/tree_schema_compile.c
@@ -42,7 +42,7 @@
 #include "xpath.h"
 
 static LY_ERR lys_compile_ext(struct lysc_ctx *ctx, struct lysp_ext_instance *ext_p, struct lysc_ext_instance *ext,
-                              void *parent, LYEXT_PARENT parent_type, const struct lys_module *ext_mod);
+        void *parent, LYEXT_PARENT parent_type, const struct lys_module *ext_mod);
 
 /**
  * @brief Duplicate string into dictionary
@@ -150,7 +150,7 @@
 
 static LY_ERR
 lysc_incomplete_leaf_dflt_add(struct lysc_ctx *ctx, struct lysc_node_leaf *leaf, const char *dflt,
-                              struct lys_module *dflt_mod)
+        struct lys_module *dflt_mod)
 {
     struct lysc_incomplete_dflt *r;
     uint32_t i;
@@ -187,7 +187,7 @@
  */
 static LY_ERR
 lysc_incomplete_llist_dflts_add(struct lysc_ctx *ctx, struct lysc_node_leaflist *llist, const char **dflts,
-                                struct lys_module *dflt_mod)
+        struct lys_module *dflt_mod)
 {
     struct lysc_incomplete_dflt *r;
     uint32_t i;
@@ -541,7 +541,7 @@
  */
 static LY_ERR
 lys_compile_ext(struct lysc_ctx *ctx, struct lysp_ext_instance *ext_p, struct lysc_ext_instance *ext, void *parent,
-                LYEXT_PARENT parent_type, const struct lys_module *ext_mod)
+        LYEXT_PARENT parent_type, const struct lys_module *ext_mod)
 {
     LY_ERR ret = LY_EVALID;
     const char *name;
@@ -992,7 +992,7 @@
 
 LY_ERR
 lys_identity_precompile(struct lysc_ctx *ctx_sc, struct ly_ctx *ctx, struct lys_module *module,
-                        struct lysp_ident *identities_p, struct lysc_ident **identities)
+        struct lysp_ident *identities_p, struct lysc_ident **identities)
 {
     LY_ARRAY_COUNT_TYPE offset = 0, u, v;
     struct lysc_ctx context = {0};
@@ -1109,7 +1109,7 @@
  */
 static LY_ERR
 lys_compile_identity_bases(struct lysc_ctx *ctx, struct lys_module *context_module, const char **bases_p,
-                           struct lysc_ident *ident, struct lysc_ident ***bases)
+        struct lysc_ident *ident, struct lysc_ident ***bases)
 {
     LY_ARRAY_COUNT_TYPE u, v;
     const char *s, *name;
@@ -1212,7 +1212,7 @@
 
 LY_ERR
 lys_feature_precompile(struct lysc_ctx *ctx_sc, struct ly_ctx *ctx, struct lys_module *module,
-                       struct lysp_feature *features_p, struct lysc_feature **features)
+        struct lysp_feature *features_p, struct lysc_feature **features)
 {
     LY_ARRAY_COUNT_TYPE offset = 0, u;
     struct lysc_ctx context = {0};
@@ -1325,7 +1325,6 @@
     struct lysc_feature *feature, **df;
     LY_ERR ret = LY_SUCCESS;
 
-
     /* find the preprecompiled feature */
     LY_ARRAY_FOR(features, x) {
         if (strcmp(features[x].name, feature_p->name)) {
@@ -1527,7 +1526,7 @@
  */
 static LY_ERR
 range_part_minmax(struct lysc_ctx *ctx, struct lysc_range_part *part, int max, int64_t prev, LY_DATA_TYPE basetype,
-                  int first, int length_restr, uint8_t frdigits, struct lysc_range *base_range, const char **value)
+        int first, int length_restr, uint8_t frdigits, struct lysc_range *base_range, const char **value)
 {
     LY_ERR ret = LY_SUCCESS;
     char *valcopy = NULL;
@@ -1668,7 +1667,7 @@
         LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SYNTAX_YANG,
                        "Invalid %s restriction - values are not in ascending order (%s).",
                        length_restr ? "length" : "range",
-                       (valcopy && basetype != LY_TYPE_DEC64) ? valcopy : value ? *value : max ? "max" : "min");
+                (valcopy && basetype != LY_TYPE_DEC64) ? valcopy : value ? *value : max ? "max" : "min");
     } else if (!ret && value) {
         *value = *value + len;
     }
@@ -1690,7 +1689,7 @@
  */
 static LY_ERR
 lys_compile_type_range(struct lysc_ctx *ctx, struct lysp_restr *range_p, LY_DATA_TYPE basetype, int length_restr,
-                       uint8_t frdigits, struct lysc_range *base_range, struct lysc_range **range)
+        uint8_t frdigits, struct lysc_range *base_range, struct lysc_range **range)
 {
     LY_ERR ret = LY_EVALID;
     const char *expr;
@@ -2161,7 +2160,7 @@
  */
 static LY_ERR
 lys_compile_type_patterns(struct lysc_ctx *ctx, struct lysp_restr *patterns_p,
-                          struct lysc_pattern **base_patterns, struct lysc_pattern ***patterns)
+        struct lysc_pattern **base_patterns, struct lysc_pattern ***patterns)
 {
     struct lysc_pattern **pattern;
     LY_ARRAY_COUNT_TYPE u;
@@ -2226,8 +2225,7 @@
  */
 const char* ly_data_type2str[LY_DATA_TYPE_COUNT] = {"unknown", "binary", "8bit unsigned integer", "16bit unsigned integer",
     "32bit unsigned integer", "64bit unsigned integer", "string", "bits", "boolean", "decimal64", "empty", "enumeration",
-    "identityref", "instance-identifier", "leafref", "union", "8bit integer", "16bit integer", "32bit integer", "64bit integer"
-};
+    "identityref", "instance-identifier", "leafref", "union", "8bit integer", "16bit integer", "32bit integer", "64bit integer"};
 
 /**
  * @brief Compile parsed type's enum structures (for enumeration and bits types).
@@ -2240,7 +2238,7 @@
  */
 static LY_ERR
 lys_compile_type_enums(struct lysc_ctx *ctx, struct lysp_type_enum *enums_p, LY_DATA_TYPE basetype,
-                       struct lysc_type_bitenum_item *base_enums, struct lysc_type_bitenum_item **enums)
+        struct lysc_type_bitenum_item *base_enums, struct lysc_type_bitenum_item **enums)
 {
     LY_ERR ret = LY_SUCCESS;
     LY_ARRAY_COUNT_TYPE u, v, match = 0;
@@ -2320,7 +2318,7 @@
                     if (e->value == (*enums)[v].value) {
                         LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SYNTAX_YANG,
                                "Invalid bits - position %u collide in items \"%s\" and \"%s\".",
-                               (uint32_t)e->value, e->name, (*enums)[v].name);
+                                (uint32_t)e->value, e->name, (*enums)[v].name);
                         return LY_EVALID;
                     }
                 }
@@ -2397,7 +2395,7 @@
  */
 LY_ERR
 lys_path_token(const char **path, const char **prefix, size_t *prefix_len, const char **name, size_t *name_len,
-               int *parent_times, int *has_predicate)
+        int *parent_times, int *has_predicate)
 {
     int par_times = 0;
 
@@ -2507,8 +2505,8 @@
 }
 
 static LY_ERR lys_compile_type(struct lysc_ctx *ctx, struct lysp_node *context_node_p, uint16_t context_flags,
-                               struct lysp_module *context_mod, const char *context_name, struct lysp_type *type_p,
-                               struct lysc_type **type, const char **units, const char **dflt, struct lys_module **dflt_mod);
+        struct lysp_module *context_mod, const char *context_name, struct lysp_type *type_p,
+        struct lysc_type **type, const char **units, const char **dflt, struct lys_module **dflt_mod);
 
 /**
  * @brief The core of the lys_compile_type() - compile information about the given type (from typedef or leaf/leaf-list).
@@ -2527,9 +2525,9 @@
  */
 static LY_ERR
 lys_compile_type_(struct lysc_ctx *ctx, struct lysp_node *context_node_p, uint16_t context_flags,
-                  struct lysp_module *context_mod, const char *context_name, struct lysp_type *type_p,
-                  struct lys_module *module, LY_DATA_TYPE basetype, const char *tpdfname, struct lysc_type *base,
-                  struct lysc_type **type)
+        struct lysp_module *context_mod, const char *context_name, struct lysp_type *type_p,
+        struct lys_module *module, LY_DATA_TYPE basetype, const char *tpdfname, struct lysc_type *base,
+        struct lysc_type **type)
 {
     LY_ERR ret = LY_SUCCESS;
     struct lysc_type_bin *bin;
@@ -2566,7 +2564,7 @@
         if (type_p->bits) {
             LY_CHECK_RET(lys_compile_type_enums(ctx, type_p->bits, basetype,
                                                 base ? (struct lysc_type_bitenum_item*)((struct lysc_type_bits*)base)->bits : NULL,
-                                                (struct lysc_type_bitenum_item**)&bits->bits));
+                    (struct lysc_type_bitenum_item**)&bits->bits));
         }
 
         if (!base && !type_p->flags) {
@@ -2915,8 +2913,8 @@
  */
 static LY_ERR
 lys_compile_type(struct lysc_ctx *ctx, struct lysp_node *context_node_p, uint16_t context_flags,
-                 struct lysp_module *context_mod, const char *context_name, struct lysp_type *type_p,
-                 struct lysc_type **type, const char **units, const char **dflt, struct lys_module **dflt_mod)
+        struct lysp_module *context_mod, const char *context_name, struct lysp_type *type_p,
+        struct lysc_type **type, const char **units, const char **dflt, struct lys_module **dflt_mod)
 {
     LY_ERR ret = LY_SUCCESS;
     unsigned int u;
@@ -3167,7 +3165,7 @@
                 /* do not print the warning when inheriting status from uses - the uses_status value has a special
                  * combination of bits (0x3) which marks the uses_status value */
                 LOGWRN(ctx->ctx, "Missing explicit \"%s\" status that was already specified in parent, inheriting.",
-                       (parent_flags & LYS_STATUS_DEPRC) ? "deprecated" : "obsolete");
+                        (parent_flags & LYS_STATUS_DEPRC) ? "deprecated" : "obsolete");
             }
             (*node_flags) |= parent_flags & LYS_STATUS_MASK;
         } else {
@@ -3179,7 +3177,7 @@
             if ((*node_flags) & LYS_STATUS_CURR) {
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS,
                        "A \"current\" status is in conflict with the parent's \"%s\" status.",
-                       (parent_flags & LYS_STATUS_DEPRC) ? "deprecated" : "obsolete");
+                        (parent_flags & LYS_STATUS_DEPRC) ? "deprecated" : "obsolete");
             } else { /* LYS_STATUS_DEPRC */
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS,
                        "A \"deprecated\" status is in conflict with the parent's \"obsolete\" status.");
@@ -3207,7 +3205,7 @@
  */
 static LY_ERR
 lys_compile_node_uniqness(struct lysc_ctx *ctx, const struct lysc_node *children, const struct lysc_action *actions,
-                          const struct lysc_notif *notifs, const char *name, void *exclude)
+        const struct lysc_notif *notifs, const char *name, void *exclude)
 {
     const struct lysc_node *iter;
     LY_ARRAY_COUNT_TYPE u;
@@ -3247,7 +3245,7 @@
  */
 static LY_ERR
 lys_compile_action(struct lysc_ctx *ctx, struct lysp_action *action_p,
-                   struct lysc_node *parent, struct lysc_action *action, uint16_t uses_status)
+        struct lysc_node *parent, struct lysc_action *action, uint16_t uses_status)
 {
     LY_ERR ret = LY_SUCCESS;
     struct lysp_node *child_p;
@@ -3332,7 +3330,7 @@
  */
 static LY_ERR
 lys_compile_notif(struct lysc_ctx *ctx, struct lysp_notif *notif_p,
-                  struct lysc_node *parent, struct lysc_notif *notif, uint16_t uses_status)
+        struct lysc_node *parent, struct lysc_notif *notif, uint16_t uses_status)
 {
     LY_ERR ret = LY_SUCCESS;
     struct lysp_node *child_p;
@@ -3463,7 +3461,7 @@
  */
 static LY_ERR
 lys_compile_node_type(struct lysc_ctx *ctx, struct lysp_node *context_node, struct lysp_type *type_p,
-                      struct lysc_node_leaf *leaf)
+        struct lysc_node_leaf *leaf)
 {
     const char *dflt;
     struct lys_module *dflt_mod;
@@ -3620,7 +3618,7 @@
             /* unique node must be present */
             LY_ARRAY_NEW_RET(ctx->ctx, *unique, key, LY_EMEM);
             ret = lys_resolve_schema_nodeid(ctx, keystr, len, (struct lysc_node*)list, context_module, LYS_LEAF, 0,
-                                            (const struct lysc_node**)key, &flags);
+                            (const struct lysc_node**)key, &flags);
             if (ret != LY_SUCCESS) {
                 if (ret == LY_EDENIED) {
                     LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_REFERENCE,
@@ -3635,7 +3633,6 @@
                 return LY_EVALID;
             }
 
-
             /* all referenced leafs must be of the same config type */
             if (config != -1 && ((((*key)->flags & LYS_CONFIG_W) && config == 0) || (((*key)->flags & LYS_CONFIG_R) && config == 1))) {
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS,
@@ -3658,7 +3655,7 @@
 
             /* check status */
             LY_CHECK_RET(lysc_check_status(ctx, list->flags, list->module, list->name,
-                                           (*key)->flags, (*key)->module, (*key)->name));
+                    (*key)->flags, (*key)->module, (*key)->name));
 
             /* mark leaf as unique */
             (*key)->flags |= LYS_UNIQUE;
@@ -4187,7 +4184,7 @@
  */
 static LY_ERR
 lys_compile_change_config(struct lysc_ctx *ctx, struct lysc_node *node, uint16_t config_flag,
-                          int inheriting, int refine_flag)
+        int inheriting, int refine_flag)
 {
     struct lysc_node *child;
     uint16_t config = config_flag & LYS_CONFIG_MASK;
@@ -4595,12 +4592,12 @@
     struct lysc_node *node, *child, *iter;
     /* context_node_fake allows us to temporarily isolate the nodes inserted from the grouping instead of uses */
     struct lysc_node_container context_node_fake =
-        {.nodetype = LYS_CONTAINER,
-         .module = ctx->mod,
-         .flags = parent ? parent->flags : 0,
-         .child = NULL, .next = NULL,
-         .prev = (struct lysc_node*)&context_node_fake,
-         .actions = NULL, .notifs = NULL};
+    {.nodetype = LYS_CONTAINER,
+        .module = ctx->mod,
+        .flags = parent ? parent->flags : 0,
+        .child = NULL, .next = NULL,
+        .prev = (struct lysc_node*)&context_node_fake,
+        .actions = NULL, .notifs = NULL};
     struct lysp_grp *grp = NULL;
     LY_ARRAY_COUNT_TYPE u, v;
     uint32_t grp_stack_count;
@@ -4790,7 +4787,6 @@
         }
     }
 
-
     /* sort and apply augments */
     LY_CHECK_GOTO(lys_compile_augment_sort(ctx, uses_p->augments, NULL, &augments), cleanup);
     LY_ARRAY_FOR(augments, u) {
@@ -4814,7 +4810,7 @@
         if (rfn->dflts) {
             if ((node->nodetype != LYS_LEAFLIST) && LY_ARRAY_COUNT(rfn->dflts) > 1) {
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS,
-                       "Invalid refine of default - %s cannot hold %"LY_PRI_ARRAY_COUNT_TYPE" default values.",
+                       "Invalid refine of default - %s cannot hold %"LY_PRI_ARRAY_COUNT_TYPE " default values.",
                        lys_nodetype2str(node->nodetype), LY_ARRAY_COUNT(rfn->dflts));
                 goto cleanup;
             }
@@ -4951,7 +4947,7 @@
             default:
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS,
                        "Invalid refine of %s statement - %s cannot hold this statement.",
-                       (rfn->flags & LYS_SET_MAX) ? "max-elements" : "min-elements", lys_nodetype2str(node->nodetype));
+                        (rfn->flags & LYS_SET_MAX) ? "max-elements" : "min-elements", lys_nodetype2str(node->nodetype));
                 goto cleanup;
             }
         }
@@ -4991,7 +4987,7 @@
             if (min > max) {
                 LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LYVE_SEMANTICS,
                        "Invalid refine of %s statement - \"min-elements\" is bigger than \"max-elements\".",
-                       (rfn->flags & LYS_SET_MAX) ? "max-elements" : "min-elements");
+                        (rfn->flags & LYS_SET_MAX) ? "max-elements" : "min-elements");
                 goto cleanup;
             }
         }
@@ -5254,8 +5250,8 @@
     if (node->nodetype & (LYS_LIST | LYS_LEAFLIST)) {
         if ((node->flags & LYS_CONFIG_R) && (node->flags & LYS_ORDBY_MASK)) {
             LOGWRN(ctx->ctx, "The ordered-by statement is ignored in lists representing %s (%s).",
-                   (ctx->options & LYSC_OPT_RPC_OUTPUT) ? "RPC/action output parameters" :
-                           (ctx->options & LYSC_OPT_NOTIFICATION) ? "notification content" : "state data", ctx->path);
+                    (ctx->options & LYSC_OPT_RPC_OUTPUT) ? "RPC/action output parameters" :
+                    (ctx->options & LYSC_OPT_NOTIFICATION) ? "notification content" : "state data", ctx->path);
             node->flags &= ~LYS_ORDBY_MASK;
             node->flags |= LYS_ORDBY_SYSTEM;
         } else if (!(node->flags & LYS_ORDBY_MASK)) {
@@ -5311,9 +5307,7 @@
             }
             cs = lys_compile_node_case(ctx, node_p->parent, (struct lysc_node_choice*)parent, node);
             LY_CHECK_ERR_GOTO(!cs, ret = LY_EVALID, error);
-            if (uses_status) {
-
-            }
+            if (uses_status) {}
             /* the postponed status check of the node and its real parent - in case of implicit case,
              * it directly gets the same status flags as the choice;
              * uses_status cannot be applied here since uses cannot be child statement of choice */
@@ -5563,7 +5557,7 @@
                                     x, lys_compile_must, ret, cleanup);
                 break;
             }
-            /* fall through */
+        /* fall through */
         default:
             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LY_VCODE_DEV_NODETYPE,
                     lys_nodetype2str(target->nodetype), "add", "must");
@@ -5940,7 +5934,7 @@
                 DEV_DEL_ARRAY(struct lysc_action*, output.musts, musts, .arg, .cond->expr, &, lysc_must_free, "must");
                 break;
             }
-            /* fall through */
+        /* fall through */
         default:
             LOGVAL(ctx->ctx, LY_VLOG_STR, ctx->path, LY_VCODE_DEV_NODETYPE,
                     lys_nodetype2str(target->nodetype), "delete", "must");
@@ -6312,7 +6306,7 @@
     /* not-supported */
     if (dev->not_supported) {
         if (LY_ARRAY_COUNT(dev->deviates) > 1) {
-            LOGWRN(ctx->ctx, "Useless multiple (%"LY_PRI_ARRAY_COUNT_TYPE") deviates on node \"%s\" since the node is not-supported.",
+            LOGWRN(ctx->ctx, "Useless multiple (%"LY_PRI_ARRAY_COUNT_TYPE ") deviates on node \"%s\" since the node is not-supported.",
                     LY_ARRAY_COUNT(dev->deviates), dev->nodeid);
         }
 
@@ -6465,7 +6459,7 @@
 
         /* resolve the target */
         LY_CHECK_GOTO(lys_resolve_schema_nodeid(ctx, dev->nodeid, 0, NULL, ctx->mod, 0, 1,
-                                                (const struct lysc_node**)&target, &flags), cleanup);
+                (const struct lysc_node**)&target, &flags), cleanup);
         if (target->nodetype & (LYS_RPC | LYS_ACTION)) {
             /* move the target pointer to input/output to make them different from the action and
              * between them. Before the devs[] item is being processed, the target pointer must be fixed
@@ -7068,7 +7062,7 @@
 
 static LY_ERR
 lys_compile_unres_dflt(struct lysc_ctx *ctx, struct lysc_node *node, struct lysc_type *type, const char *dflt,
-                       const struct lys_module *dflt_mod, struct lyd_value *storage)
+        const struct lys_module *dflt_mod, struct lyd_value *storage)
 {
     LY_ERR ret;
     struct ly_err_item *err = NULL;
@@ -7092,7 +7086,7 @@
 
 static LY_ERR
 lys_compile_unres_leaf_dlft(struct lysc_ctx *ctx, struct lysc_node_leaf *leaf, const char *dflt,
-                            const struct lys_module *dflt_mod)
+        const struct lys_module *dflt_mod)
 {
     LY_ERR ret;
 
@@ -7119,7 +7113,7 @@
 
 static LY_ERR
 lys_compile_unres_llist_dflts(struct lysc_ctx *ctx, struct lysc_node_leaflist *llist, const char *dflt, const char **dflts,
-                              const struct lys_module *dflt_mod)
+        const struct lys_module *dflt_mod)
 {
     LY_ERR ret;
     LY_ARRAY_COUNT_TYPE orig_count, u, v;
diff --git a/src/tree_schema_free.c b/src/tree_schema_free.c
index 3352134..0ab7de9 100644
--- a/src/tree_schema_free.c
+++ b/src/tree_schema_free.c
@@ -591,6 +591,7 @@
 {
     lysc_type_free(ctx, *type);
 }
+
 void
 lysc_type_free(struct ly_ctx *ctx, struct lysc_type *type)
 {
@@ -939,7 +940,7 @@
             break;
         }
 
-            /* TODO other statements */
+        /* TODO other statements */
         default:
             LOGINT(ctx);
         }
diff --git a/src/tree_schema_helpers.c b/src/tree_schema_helpers.c
index 36e4779..4316d98 100644
--- a/src/tree_schema_helpers.c
+++ b/src/tree_schema_helpers.c
@@ -36,8 +36,8 @@
 
 LY_ERR
 lys_resolve_schema_nodeid(struct lysc_ctx *ctx, const char *nodeid, size_t nodeid_len, const struct lysc_node *context_node,
-                          const struct lys_module *context_module, int nodetype, int implement,
-                          const struct lysc_node **target, uint16_t *result_flag)
+        const struct lys_module *context_module, int nodetype, int implement,
+        const struct lysc_node **target, uint16_t *result_flag)
 {
     LY_ERR ret = LY_EVALID;
     const char *name, *prefix, *id;
@@ -171,8 +171,8 @@
 
 LY_ERR
 lysc_check_status(struct lysc_ctx *ctx,
-                  uint16_t flags1, void *mod1, const char *name1,
-                  uint16_t flags2, void *mod2, const char *name2)
+        uint16_t flags1, void *mod1, const char *name1,
+        uint16_t flags2, void *mod2, const char *name2)
 {
     uint16_t flg1, flg2;
 
@@ -353,7 +353,7 @@
 
 LY_ERR
 lysp_type_find(const char *id, struct lysp_node *start_node, struct lysp_module *start_module,
-               LY_DATA_TYPE *type, const struct lysp_tpdf **tpdf, struct lysp_node **node, struct lysp_module **module)
+        LY_DATA_TYPE *type, const struct lysp_tpdf **tpdf, struct lysp_node **node, struct lysp_module **module)
 {
     const char *str, *name;
     struct lysp_tpdf *typedefs;
@@ -462,7 +462,7 @@
  */
 static LY_ERR
 lysp_check_typedef(struct lys_parser_ctx *ctx, struct lysp_node *node, const struct lysp_tpdf *tpdf,
-                   struct hash_table *tpdfs_global, struct hash_table *tpdfs_scoped)
+        struct hash_table *tpdfs_global, struct hash_table *tpdfs_scoped)
 {
     struct lysp_node *parent;
     uint32_t hash;
@@ -532,7 +532,7 @@
 
 LY_ERR
 lysp_parse_finalize_reallocated(struct lys_parser_ctx *ctx, struct lysp_grp *groupings, struct lysp_augment *augments,
-                                struct lysp_action *actions, struct lysp_notif *notifs)
+        struct lysp_action *actions, struct lysp_notif *notifs)
 {
     LY_ARRAY_COUNT_TYPE u, v;
     struct lysp_node *child;
@@ -746,7 +746,7 @@
 
 LY_ERR
 lys_module_localfile(struct ly_ctx *ctx, const char *name, const char *revision, int implement,
-                     struct lys_parser_ctx *main_ctx, const char *main_name, int required, void **result)
+        struct lys_parser_ctx *main_ctx, const char *main_name, int required, void **result)
 {
     struct ly_in *in;
     char *filepath = NULL;
@@ -776,10 +776,10 @@
     check_data.submoduleof = main_name;
     if (main_ctx) {
         ret = lys_parse_mem_submodule(ctx, in, format, main_ctx, lysp_load_module_check, &check_data,
-                                      (struct lysp_submodule **)&mod);
+                        (struct lysp_submodule **)&mod);
     } else {
         ret = lys_parse_mem_module(ctx, in, format, implement, lysp_load_module_check, &check_data,
-                                   (struct lys_module **)&mod);
+                        (struct lys_module **)&mod);
 
     }
     LY_CHECK_ERR_GOTO(ret, ly_in_free(in, 1), cleanup);
@@ -805,7 +805,7 @@
 
 LY_ERR
 lysp_load_module(struct ly_ctx *ctx, const char *name, const char *revision, int implement, int require_parsed,
-                 struct lys_module **mod)
+        struct lys_module **mod)
 {
     const char *module_data = NULL;
     LYS_INFORMAT format = LYS_IN_UNKNOWN;
@@ -1000,7 +1000,7 @@
         if (!(ctx->flags & LY_CTX_DISABLE_SEARCHDIRS)) {
             /* submodule was not received from the callback or there is no callback set */
             lys_module_localfile(ctx, inc->name, inc->rev[0] ? inc->rev : NULL, 0, pctx, pctx->main_mod->name, 1,
-                                 (void**)&submod);
+                    (void**)&submod);
         }
         if (!submod && (ctx->flags & LY_CTX_PREFER_SEARCHDIRS)) {
             goto search_clb;
diff --git a/src/tree_schema_internal.h b/src/tree_schema_internal.h
index 9ed3b3f..0fcb983 100644
--- a/src/tree_schema_internal.h
+++ b/src/tree_schema_internal.h
@@ -257,7 +257,7 @@
  */
 LY_ERR
 lysp_parse_finalize_reallocated(struct lys_parser_ctx *ctx, struct lysp_grp *groupings, struct lysp_augment *augments,
-                                struct lysp_action *actions, struct lysp_notif *notifs);
+        struct lysp_action *actions, struct lysp_notif *notifs);
 
 /**
  * @brief Just move the newest revision into the first position, does not sort the rest
@@ -277,7 +277,7 @@
  * @param[out] module Module where the found typedef is being defined, NULL in case of built-in YANG types.
  */
 LY_ERR lysp_type_find(const char *id, struct lysp_node *start_node, struct lysp_module *start_module,
-                      LY_DATA_TYPE *type, const struct lysp_tpdf **tpdf, struct lysp_node **node, struct lysp_module **module);
+        LY_DATA_TYPE *type, const struct lysp_tpdf **tpdf, struct lysp_node **node, struct lysp_module **module);
 
 /**
  * @brief Validate enum name.
@@ -419,8 +419,8 @@
  * @return LY_ERR value
  */
 LY_ERR lysc_check_status(struct lysc_ctx *ctx,
-                         uint16_t flags1, void *mod1, const char *name1,
-                         uint16_t flags2, void *mod2, const char *name2);
+        uint16_t flags1, void *mod1, const char *name1,
+        uint16_t flags2, void *mod2, const char *name2);
 
 /**
  * @brief Find the node according to the given descendant/absolute schema nodeid.
@@ -443,8 +443,8 @@
  * @return LY_ERR values - LY_ENOTFOUND, LY_EVALID, LY_EDENIED or LY_SUCCESS.
  */
 LY_ERR lys_resolve_schema_nodeid(struct lysc_ctx *ctx, const char *nodeid, size_t nodeid_len, const struct lysc_node *context_node,
-                                 const struct lys_module *context_module, int nodetype, int implement,
-                                 const struct lysc_node **target, uint16_t *result_flag);
+        const struct lys_module *context_module, int nodetype, int implement,
+        const struct lysc_node **target, uint16_t *result_flag);
 
 /**
  * @brief Find the module referenced by prefix in the provided mod.
@@ -480,7 +480,7 @@
 const char *lys_datatype2str(LY_DATA_TYPE basetype);
 
 typedef LY_ERR (*lys_custom_check)(const struct ly_ctx *ctx, struct lysp_module *mod, struct lysp_submodule *submod,
-                                   void *check_data);
+        void *check_data);
 
 /**
  * @brief Parse module from a string.
@@ -497,7 +497,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lys_parse_mem_module(struct ly_ctx *ctx, struct ly_in *in, LYS_INFORMAT format, int implement,
-                            lys_custom_check custom_check, void *check_data, struct lys_module **module);
+        lys_custom_check custom_check, void *check_data, struct lys_module **module);
 
 /**
  * @brief Parse submodule from a string.
@@ -514,8 +514,8 @@
  * @return LY_ERR value.
  */
 LY_ERR lys_parse_mem_submodule(struct ly_ctx *ctx, struct ly_in *in, LYS_INFORMAT format,
-                               struct lys_parser_ctx *main_ctx, lys_custom_check custom_check,
-                               void *check_data, struct lysp_submodule **submodule);
+        struct lys_parser_ctx *main_ctx, lys_custom_check custom_check,
+        void *check_data, struct lysp_submodule **submodule);
 
 /**
  * @brief Fill filepath value if available in input handler @p in
@@ -546,7 +546,7 @@
  * @return LY_ERR value, in case of LY_SUCCESS, the \arg result is always provided.
  */
 LY_ERR lys_module_localfile(struct ly_ctx *ctx, const char *name, const char *revision, int implement,
-                            struct lys_parser_ctx *main_ctx, const char *main_name, int required, void **result);
+        struct lys_parser_ctx *main_ctx, const char *main_name, int required, void **result);
 
 /**
  * @brief Compile information from the identity statement
@@ -563,7 +563,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lys_identity_precompile(struct lysc_ctx *ctx_sc, struct ly_ctx *ctx, struct lys_module *module,
-                               struct lysp_ident *identities_p, struct lysc_ident **identities);
+        struct lysp_ident *identities_p, struct lysc_ident **identities);
 
 /**
  * @brief Create pre-compiled features array.
@@ -587,7 +587,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lys_feature_precompile(struct lysc_ctx *ctx_sc, struct ly_ctx *ctx, struct lys_module *module,
-                              struct lysp_feature *features_p, struct lysc_feature **features);
+        struct lysp_feature *features_p, struct lysc_feature **features);
 
 /**
  * @brief Get the @ref ifftokens from the given position in the 2bits array
@@ -770,7 +770,7 @@
  * In case the @p buffer is NULL, the returned string is dynamically allocated and caller is responsible to free it.
  */
 char *lysc_path_until(const struct lysc_node *node, const struct lysc_node *parent, LYSC_PATH_TYPE pathtype, char *buffer,
-                      size_t buflen);
+        size_t buflen);
 
 /**
  * @brief Get schema parent that can be instantiated in data. In other words, skip any choice or case nodes.
diff --git a/src/validation.c b/src/validation.c
index 16c776e..7a7046a 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -111,7 +111,7 @@
 
 LY_ERR
 lyd_validate_unres(struct lyd_node **tree, struct ly_set *node_when, struct ly_set *node_types, struct ly_set *meta_types,
-                   LY_PREFIX_FORMAT format, void *prefix_data, struct lyd_node **diff)
+        LY_PREFIX_FORMAT format, void *prefix_data, struct lyd_node **diff)
 {
     LY_ERR ret = LY_SUCCESS;
     uint32_t i;
@@ -156,7 +156,7 @@
                 }
             }
 
-        /* there must have been some when conditions resolved */
+            /* there must have been some when conditions resolved */
         } while (prev_count > node_when->count);
 
         /* there could have been no cyclic when dependencies, checked during compilation */
@@ -411,7 +411,7 @@
 
 LY_ERR
 lyd_validate_new(struct lyd_node **first, const struct lysc_node *sparent, const struct lys_module *mod,
-                 struct lyd_node **diff)
+        struct lyd_node **diff)
 {
     struct lyd_node *next, *node;
     const struct lysc_node *snode = NULL;
@@ -792,7 +792,7 @@
  */
 static LY_ERR
 lyd_validate_siblings_schema_r(const struct lyd_node *first, const struct lysc_node *sparent,
-                               const struct lysc_module *mod, int val_opts, LYD_VALIDATE_OP op)
+        const struct lysc_module *mod, int val_opts, LYD_VALIDATE_OP op)
 {
     const struct lysc_node *snode = NULL;
     struct lysc_node_list *slist;
@@ -944,7 +944,7 @@
 
 LY_ERR
 lyd_validate_final_r(struct lyd_node *first, const struct lysc_node *sparent, const struct lys_module *mod, int val_opts,
-                     LYD_VALIDATE_OP op)
+        LYD_VALIDATE_OP op)
 {
     struct lyd_node *next = NULL, *node;
     const struct lysc_node *snode;
@@ -959,7 +959,7 @@
         /* opaque data */
         if (!node->schema) {
             LOGVAL(LYD_CTX(node), LY_VLOG_LYD, node, LYVE_DATA, "Opaque node \"%s\" found.",
-                   ((struct lyd_node_opaq *)node)->name);
+                    ((struct lyd_node_opaq *)node)->name);
             return LY_EVALID;
         }
 
@@ -1026,7 +1026,7 @@
  */
 static LY_ERR
 lyd_validate_subtree(struct lyd_node *root, struct ly_set *type_check, struct ly_set *type_meta_check,
-                     struct ly_set *when_check, int val_opts, struct lyd_node **diff)
+        struct ly_set *when_check, int val_opts, struct lyd_node **diff)
 {
     const struct lyd_meta *meta;
     struct lyd_node *node;
@@ -1077,7 +1077,7 @@
  */
 static LY_ERR
 lyd_validate(struct lyd_node **tree, const struct lys_module *module, const struct ly_ctx *ctx, int val_opts,
-              struct lyd_node **diff)
+        struct lyd_node **diff)
 {
     LY_ERR ret = LY_SUCCESS;
     struct lyd_node *first, *next, **first2;
@@ -1161,7 +1161,7 @@
  */
 static void
 lyd_val_op_merge_find(const struct lyd_node *op_tree, const struct lyd_node *op_node, const struct lyd_node *tree,
-                      struct lyd_node **op_subtree, struct lyd_node **tree_sibling)
+        struct lyd_node **op_subtree, struct lyd_node **tree_sibling)
 {
     const struct lyd_node *tree_iter, *op_iter;
     struct lyd_node *match;
@@ -1209,7 +1209,7 @@
     struct ly_set type_check = {0}, type_meta_check = {0}, when_check = {0};
 
     LY_CHECK_ARG_RET(NULL, op_tree, !op_tree->parent, !tree || !tree->parent,
-                     (op == LYD_VALIDATE_OP_NOTIF) || (op == LYD_VALIDATE_OP_RPC) || (op == LYD_VALIDATE_OP_REPLY), LY_EINVAL);
+            (op == LYD_VALIDATE_OP_NOTIF) || (op == LYD_VALIDATE_OP_RPC) || (op == LYD_VALIDATE_OP_REPLY), LY_EINVAL);
     if (diff) {
         *diff = NULL;
     }
diff --git a/src/validation.h b/src/validation.h
index f3404df..4cdf277 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -47,7 +47,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_validate_unres(struct lyd_node **tree, struct ly_set *node_when, struct ly_set *node_types, struct ly_set *meta_types,
-                          LY_PREFIX_FORMAT format, void *prefix_data, struct lyd_node **diff);
+        LY_PREFIX_FORMAT format, void *prefix_data, struct lyd_node **diff);
 
 /**
  * @brief Validate new siblings. Specifically, check duplicated instances, autodelete default values and cases.
@@ -61,7 +61,7 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_validate_new(struct lyd_node **first, const struct lysc_node *sparent, const struct lys_module *mod,
-                        struct lyd_node **diff);
+        struct lyd_node **diff);
 
 /**
  * @brief Perform all remaining validation tasks, the data tree must be final when calling this function.
@@ -74,6 +74,6 @@
  * @return LY_ERR value.
  */
 LY_ERR lyd_validate_final_r(struct lyd_node *first, const struct lysc_node *sparent, const struct lys_module *mod,
-                            int val_opts, LYD_VALIDATE_OP op);
+        int val_opts, LYD_VALIDATE_OP op);
 
 #endif /* LY_VALIDATION_H_ */
diff --git a/src/xml.c b/src/xml.c
index 8b83876..8bdfb07 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -39,7 +39,7 @@
 #define ign_xmlws(c) while (is_xmlws(*(c)->in->current)) {if (*(c)->in->current == '\n') {++c->line;} ly_in_skip(c->in, 1);}
 
 static LY_ERR lyxml_next_attr_content(struct lyxml_ctx *xmlctx, const char **value, size_t *value_len, int *ws_only,
-                                      int *dynamic);
+        int *dynamic);
 
 /**
  * @brief Ignore any characters until the delim of the size delim_len is read
@@ -519,7 +519,7 @@
  */
 static LY_ERR
 lyxml_close_element(struct lyxml_ctx *xmlctx, const char *prefix, size_t prefix_len, const char *name, size_t name_len,
-                    int empty)
+        int empty)
 {
     struct lyxml_elem *e;
 
@@ -763,7 +763,7 @@
  */
 static LY_ERR
 lyxml_next_element(struct lyxml_ctx *xmlctx, const char **prefix, size_t *prefix_len, const char **name, size_t *name_len,
-                   int *closing)
+        int *closing)
 {
     /* skip WS until EOF or after opening tag '<' */
     LY_CHECK_RET(lyxml_skip_until_end_or_after_otag(xmlctx));
@@ -863,7 +863,7 @@
             xmlctx->status = LYXML_ELEM_CLOSE;
             break;
         }
-        /* fallthrough */
+    /* fallthrough */
 
     /* </elem>| <elem2>* */
     case LYXML_ELEM_CLOSE:
@@ -977,7 +977,7 @@
             *next = LYXML_ELEM_CLOSE;
             break;
         }
-        /* fallthrough */
+    /* fallthrough */
     case LYXML_ELEM_CLOSE:
         /* parse next element, if any */
         ret = lyxml_next_element(xmlctx, &prefix, &prefix_len, &name, &name_len, &closing);
@@ -1066,7 +1066,7 @@
                 ret = ly_print_(out, "&quot;");
                 break;
             }
-            /* falls through */
+        /* falls through */
         default:
             ret = ly_write_(out, &text[u], 1);
             break;
diff --git a/src/xml.h b/src/xml.h
index cfc2d92..8f4b47e 100644
--- a/src/xml.h
+++ b/src/xml.h
@@ -185,6 +185,6 @@
  * @return LY_ERR on error.
  */
 LY_ERR lyxml_value_compare(const char *value1, const struct ly_prefix *prefs1, const char *value2,
-                           const struct ly_prefix *prefs2);
+        const struct ly_prefix *prefs2);
 
 #endif /* LY_XML_H_ */
diff --git a/src/xpath.c b/src/xpath.c
index 9acb3c8..de1d41e 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -319,7 +319,7 @@
  */
 static LY_ERR
 cast_string_recursive(const struct lyd_node *node, int fake_cont, enum lyxp_node_type root_type, uint16_t indent, char **str,
-                      uint16_t *used, uint16_t *size)
+        uint16_t *used, uint16_t *size)
 {
     char *buf, *line, *ptr = NULL;
     const char *value_str;
@@ -798,11 +798,11 @@
         ret->ctx_size = set->ctx_size;
         ret->ht = lyht_dup(set->ht);
     } else {
-       memcpy(ret, set, sizeof *ret);
-       if (set->type == LYXP_SET_STRING) {
-           ret->val.str = strdup(set->val.str);
-           LY_CHECK_ERR_RET(!ret->val.str, LOGMEM(set->ctx); free(ret), NULL);
-       }
+        memcpy(ret, set, sizeof *ret);
+        if (set->type == LYXP_SET_STRING) {
+            ret->val.str = strdup(set->val.str);
+            LY_CHECK_ERR_RET(!ret->val.str, LOGMEM(set->ctx); free(ret), NULL);
+        }
     }
 
     return ret;
@@ -1271,7 +1271,7 @@
  */
 static uint32_t
 get_node_pos(const struct lyd_node *node, enum lyxp_node_type node_type, const struct lyd_node *root,
-             enum lyxp_node_type root_type, const struct lyd_node **prev, uint32_t *prev_pos)
+        enum lyxp_node_type root_type, const struct lyd_node **prev, uint32_t *prev_pos)
 {
     const struct lyd_node *elem = NULL, *top_sibling;
     uint32_t pos = 1;
@@ -1362,7 +1362,7 @@
                 if (!tmp_node) {
                     LOGINT_RET(root->schema->module->ctx);
                 }
-                /* fallthrough */
+            /* fallthrough */
             case LYXP_NODE_ELEM:
             case LYXP_NODE_TEXT:
                 if (!tmp_node) {
@@ -1859,7 +1859,7 @@
 /* just like lyxp_check_token() but tests for 2 tokens */
 static LY_ERR
 exp_check_token2(const struct ly_ctx *ctx, struct lyxp_expr *exp, uint16_t tok_idx, enum lyxp_token want_tok1,
-                 enum lyxp_token want_tok2)
+        enum lyxp_token want_tok2)
 {
     if (exp->used == tok_idx) {
         if (ctx) {
@@ -1981,7 +1981,7 @@
                        lyxp_print_token(exp->tokens[*tok_idx]), &exp->expr[exp->tok_pos[*tok_idx]]);
                 return LY_EVALID;
             }
-            /* fall through */
+        /* fall through */
         case LYXP_TOKEN_NAMETEST:
             ++(*tok_idx);
             goto reparse_predicate;
@@ -2050,7 +2050,7 @@
         case LYXP_TOKEN_NODETYPE:
             rc = reparse_relative_location_path(ctx, exp, tok_idx);
             LY_CHECK_RET(rc);
-            /* fall through */
+        /* fall through */
         default:
             break;
         }
@@ -3298,14 +3298,14 @@
             LOGWRN(set->ctx, "Identityref \"%s\" comparison with identity \"%s\" without prefix, consider adding"
                    " a prefix or best using \"derived-from(-or-self)()\" functions.", scnode->name, value);
             LOGWRN(set->ctx, "Previous warning generated by XPath subexpression[%u] \"%.*s\".", exp->tok_pos[equal_exp],
-                   (exp->tok_pos[last_equal_exp] - exp->tok_pos[equal_exp]) + exp->tok_len[last_equal_exp],
+                    (exp->tok_pos[last_equal_exp] - exp->tok_pos[equal_exp]) + exp->tok_len[last_equal_exp],
                    exp->expr + exp->tok_pos[equal_exp]);
         }
 
         type = ((struct lysc_node_leaf *)scnode)->type;
         if (type->basetype != LY_TYPE_IDENT) {
             rc = type->plugin->store(set->ctx, type, value, strlen(value), LY_TYPE_OPTS_SCHEMA, LY_PREF_SCHEMA,
-                                     (void *)set->local_mod, NULL, NULL, &storage, &err);
+                            (void *)set->local_mod, NULL, NULL, &storage, &err);
 
             if (err) {
                 LOGWRN(set->ctx, "Invalid value \"%s\" which does not fit the type (%s).", value, err->msg);
@@ -3315,7 +3315,7 @@
             }
             if (rc != LY_SUCCESS) {
                 LOGWRN(set->ctx, "Previous warning generated by XPath subexpression[%u] \"%.*s\".", exp->tok_pos[equal_exp],
-                    (exp->tok_pos[last_equal_exp] - exp->tok_pos[equal_exp]) + exp->tok_len[last_equal_exp],
+                        (exp->tok_pos[last_equal_exp] - exp->tok_pos[equal_exp]) + exp->tok_len[last_equal_exp],
                     exp->expr + exp->tok_pos[equal_exp]);
             } else {
                 type->plugin->free(set->ctx, &storage);
@@ -3779,7 +3779,7 @@
             /* store args[1] as ident */
             rc = val->realtype->plugin->store(set->ctx, val->realtype, args[1]->val.str, strlen(args[1]->val.str),
                                               0, set->format, (void *)set->local_mod,
-                                              (struct lyd_node *)leaf, set->tree, &data, &err);
+                            (struct lyd_node *)leaf, set->tree, &data, &err);
         } else {
             meta = args[0]->val.meta[i].meta;
             val = &meta->value;
@@ -4810,7 +4810,7 @@
         }
 
         if ((arg_count == 3) && (args[2]->type == LYXP_SET_SCNODE_SET)
-                    && (sleaf = (struct lysc_node_leaf *)warn_get_scnode_in_ctx(args[2]))) {
+                && (sleaf = (struct lysc_node_leaf *)warn_get_scnode_in_ctx(args[2]))) {
             if (!(sleaf->nodetype & (LYS_LEAF | LYS_LEAFLIST))) {
                 LOGWRN(set->ctx, "Argument #3 of %s is a %s node \"%s\".", __func__, lys_nodetype2str(sleaf->nodetype), sleaf->name);
             } else if (!warn_is_numeric_type(sleaf->type)) {
@@ -5080,7 +5080,7 @@
                 ++i;
                 break;
             }
-            /* fall through */
+        /* fall through */
         case LYXP_NODE_ROOT:
         case LYXP_NODE_ROOT_CONFIG:
         case LYXP_NODE_TEXT:
@@ -5336,7 +5336,7 @@
  */
 static LY_ERR
 moveto_node_check(const struct lyd_node *node, enum lyxp_node_type root_type, const struct lysc_node *context_op,
-                  const char *node_name, const struct lys_module *moveto_mod)
+        const char *node_name, const struct lys_module *moveto_mod)
 {
     /* module check */
     if (moveto_mod && (node->schema->module != moveto_mod)) {
@@ -5376,7 +5376,7 @@
  */
 static LY_ERR
 moveto_scnode_check(const struct lysc_node *node, enum lyxp_node_type root_type, const struct lysc_node *context_op,
-                    const char *node_name, const struct lys_module *moveto_mod)
+        const char *node_name, const struct lys_module *moveto_mod)
 {
     /* module check */
     if (moveto_mod && (node->module != moveto_mod)) {
@@ -5494,7 +5494,7 @@
     if ((set->root_type == LYXP_NODE_ROOT_CONFIG) && (scnode->flags & LYS_CONFIG_R)) {
         lyxp_set_free_content(set);
         goto cleanup;
-    }  else if (set->context_op && (scnode->nodetype & (LYS_RPC | LYS_ACTION | LYS_NOTIF))
+    } else if (set->context_op && (scnode->nodetype & (LYS_RPC | LYS_ACTION | LYS_NOTIF))
             && (scnode != set->context_op)) {
         lyxp_set_free_content(set);
         goto cleanup;
@@ -6023,7 +6023,7 @@
  */
 static LY_ERR
 moveto_self_add_children_r(const struct lyd_node *parent, uint32_t parent_pos, enum lyxp_node_type parent_type,
-                           struct lyxp_set *to_set, const struct lyxp_set *dup_check_set, int options)
+        struct lyxp_set *to_set, const struct lyxp_set *dup_check_set, int options)
 {
     const struct lyd_node *iter, *first;
     LY_ERR rc;
@@ -6821,8 +6821,8 @@
  */
 static LY_ERR
 eval_name_test_try_compile_predicates(struct lyxp_expr *exp, uint16_t *tok_idx, const struct lysc_node *scnode,
-                                      LY_PREFIX_FORMAT format, struct ly_path_predicate **predicates,
-                                      enum ly_path_pred_type *pred_type)
+        LY_PREFIX_FORMAT format, struct ly_path_predicate **predicates,
+        enum ly_path_pred_type *pred_type)
 {
     LY_ERR ret = LY_SUCCESS;
     uint16_t key_count, e_idx, pred_idx = 0;
@@ -6917,7 +6917,7 @@
  */
 static LY_ERR
 eval_name_test_with_predicate(struct lyxp_expr *exp, uint16_t *tok_idx, int attr_axis, int all_desc, struct lyxp_set *set,
-                              int options)
+        int options)
 {
     int i;
     char *path;
@@ -7068,7 +7068,7 @@
  */
 static LY_ERR
 eval_node_type_with_predicate(struct lyxp_expr *exp, uint16_t *tok_idx, int attr_axis, int all_desc,
-                              struct lyxp_set *set, int options)
+        struct lyxp_set *set, int options)
 {
     LY_ERR rc;
 
@@ -8301,7 +8301,7 @@
 
 LY_ERR
 lyxp_eval(struct lyxp_expr *exp, LY_PREFIX_FORMAT format, const struct lys_module *local_mod, const struct lyd_node *ctx_node,
-          enum lyxp_node_type ctx_node_type, const struct lyd_node *tree, struct lyxp_set *set, int options)
+        enum lyxp_node_type ctx_node_type, const struct lyd_node *tree, struct lyxp_set *set, int options)
 {
     uint16_t tok_idx = 0;
     const struct lyd_node *real_ctx_node;
@@ -8325,8 +8325,8 @@
     set->ctx_node = ctx_node;
     set->root_type = lyxp_get_root_type(real_ctx_node, NULL, options);
     for (set->context_op = ctx_node->schema;
-         set->context_op && !(set->context_op->nodetype & (LYS_RPC | LYS_ACTION | LYS_NOTIF));
-         set->context_op = set->context_op->parent) {}
+            set->context_op && !(set->context_op->nodetype & (LYS_RPC | LYS_ACTION | LYS_NOTIF));
+            set->context_op = set->context_op->parent) {}
     set->local_mod = local_mod;
     set->tree = tree;
     set->format = format;
@@ -8570,7 +8570,7 @@
 
 LY_ERR
 lyxp_atomize(struct lyxp_expr *exp, LY_PREFIX_FORMAT format, const struct lys_module *local_mod,
-             const struct lysc_node *ctx_scnode, enum lyxp_node_type ctx_scnode_type, struct lyxp_set *set, int options)
+        const struct lysc_node *ctx_scnode, enum lyxp_node_type ctx_scnode_type, struct lyxp_set *set, int options)
 {
     struct ly_ctx *ctx;
     const struct lysc_node *real_ctx_scnode;
@@ -8596,8 +8596,8 @@
     set->ctx_scnode = ctx_scnode;
     set->root_type = lyxp_get_root_type(NULL, real_ctx_scnode, options);
     for (set->context_op = ctx_scnode;
-         set->context_op && !(set->context_op->nodetype & (LYS_RPC | LYS_ACTION | LYS_NOTIF));
-         set->context_op = set->context_op->parent) {}
+            set->context_op && !(set->context_op->nodetype & (LYS_RPC | LYS_ACTION | LYS_NOTIF));
+            set->context_op = set->context_op->parent) {}
     set->local_mod = local_mod;
     set->format = format;
 
diff --git a/src/xpath.h b/src/xpath.h
index 4fb601a..1e8b3b2 100644
--- a/src/xpath.h
+++ b/src/xpath.h
@@ -291,8 +291,8 @@
  * @return LY_EINVAL, LY_EMEM, LY_EINT for other errors.
  */
 LY_ERR lyxp_eval(struct lyxp_expr *exp, LY_PREFIX_FORMAT format, const struct lys_module *local_mod,
-                 const struct lyd_node *ctx_node, enum lyxp_node_type ctx_node_type, const struct lyd_node *tree,
-                 struct lyxp_set *set, int options);
+        const struct lyd_node *ctx_node, enum lyxp_node_type ctx_node_type, const struct lyd_node *tree,
+        struct lyxp_set *set, int options);
 
 #define LYXP_SCHEMA 0x01        /**< Apply data node access restrictions defined for 'when' and 'must' evaluation. */
 
@@ -311,8 +311,8 @@
  * @return LY_ERR (same as lyxp_eval()).
  */
 LY_ERR lyxp_atomize(struct lyxp_expr *exp, LY_PREFIX_FORMAT format, const struct lys_module *local_mod,
-                    const struct lysc_node *ctx_scnode, enum lyxp_node_type ctx_scnode_type, struct lyxp_set *set,
-                    int options);
+        const struct lysc_node *ctx_scnode, enum lyxp_node_type ctx_scnode_type, struct lyxp_set *set,
+        int options);
 
 /* used only internally */
 #define LYXP_SCNODE_ALL 0x0E
@@ -354,7 +354,7 @@
  * @return Index of the found node, -1 if not found.
  */
 int lyxp_set_scnode_dup_node_check(struct lyxp_set *set, const struct lysc_node *node, enum lyxp_node_type node_type,
-                                   int skip_idx);
+        int skip_idx);
 
 /**
  * @brief Merge 2 schema node sets.