yaml_variable_scanner

Creator: coderz1093

Last updated:

0 purchases

yaml_variable_scanner Image
yaml_variable_scanner Images
Add to Cart

Description:

yaml variable scanner

πŸ““ Language: English | δΈ­ζ–‡
πŸ’‘ See the Migration Guide to learn how to migrate between breaking changes.

YAML Variable Scanner







YAML Variable Scanner, used to scan multiple files for text that can use YAML variables.




[example]


Table of contents πŸͺ„ #



Features


Example


Install


Simple usage


Run checks (config file)


yaml_variable_scanner config file




Usage

YamlVariableScanner.run() parameters



License



Features ✨ #

Important
Currently, only the following variables support checking:

{{ x.xx.xxx }}



πŸ“‚ Multiple files can be specified (Glob syntax)
πŸ—‘οΈ Ignore checks can be specified

Ignore files (Glob syntax)
Ignore YAML variables, text paragraphs (RegExp syntax)


πŸ” Support for checking existing YAML variables in text
πŸ”¦ Detailed console printout (with statistics)

Example πŸ’‘ #
Use the following command to run the check in the example:
$ dart run example --help

$ dart run example check
copied to clipboard
Install 🎯 #
Versions compatibility 🐦 #



Flutter / Dart
3.19.0+ / 3.3.0+




yaml_variable_scanner 0.0.1+
βœ…



Add package πŸ“¦ #
Run this command with Flutter,
$ dart pub add yaml_variable_scanner
copied to clipboard
or add yaml_variable_scanner to pubspec.yaml dependencies manually.
dependencies:
yaml_variable_scanner: ^latest_version
copied to clipboard
Simple usage πŸ“– #
Run checks (config file) #
import 'dart:io';
import 'package:yaml_variable_scanner/yaml_variable_scanner.dart';

YamlVariableScanner.run(
/// yaml_variable_scanner config file
'./yaml_variable_scanner.yaml',
stdout,
);
copied to clipboard
yaml_variable_scanner config file #

Create the yaml_variable_scanner.yaml file.
Complete the yaml_variable_scanner.yaml configuration.

yaml_variable_scanner:

# File path for YAML variables
yamlFilePath:
- path: "test/siteA.yaml" # YAML path (Glob syntax)
variablePrefix: "a." # Variable prefix. e.g. `a.` -> `a.x.xx`
- path: "test/siteB.yaml"
variablePrefix: "b."

# Ignore YAML file path
#
# (Glob Syntax)
ignoreYamlFilePath:
- "test/test.yaml"

# Ignore YAML Key
#
# e.g. "^a.bb$"
#
# (RegExp Syntax)
ignoreYamlKey:
- ^description$

# File path for check file contents
#
# (Glob Syntax)
checkFilePath:
- "test/**/*.md"

# Ignore file paths to check
#
# (Glob Syntax)
ignoreCheckFilePath:
- "test/content/**.md"

# Ignore text that doesn't need to match
#
# e.g.
# - `r"^\s*---([\s\S]*?)---$"`
# - `r"^\s*{%-?\s*comment\s*-?%}([\s\S]*?){%-?\s*endcomment\s*-?%}$"`
# - `r"^\s*<!---?\s*([\s\S]*?)\s*-?-->$"`
#
# (RegExp Syntax)
ignoreCheckText:
# --- xxx ---
- ^\s*---([\s\S]*?)---$

# {%- comment %} xxx {% endcomment -%}
- ^\s*{%-?\s*comment\s*-?%}([\s\S]*?){%-?\s*endcomment\s*-?%}$

# <!-- xxx -->
- ^\s*<!---?\s*([\s\S]*?)\s*-?-->$
copied to clipboard
Usage πŸ“– #
YamlVariableScanner.run() parameters πŸ€– #



Parameter
Type
Default
Description




configPath required
String
-
yaml_variable_scanner.yaml config file path.


stdout required
Stdout
-
stdout from dart:io


printMode
PrintMode
PrintMode.detail
Console Print Mode.



License πŸ“„ #

Open sourced under the MIT license.
Β© AmosHuKe

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.