Skip to content

Commit

Permalink
Update preset feature settings in yml files and README
Browse files Browse the repository at this point in the history
Simplified preset settings in 'preset_features.yml' and 'preset_usage.yml' files by combining several lines into one. These changes enhance the readability and maintainability of the code. Additionally, alignments and comments in 'preset_features.yml' and README file were adjusted for consistency and better readability.
  • Loading branch information
SmetDenis committed Apr 6, 2024
1 parent 0460bb7 commit 9a0b46a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 30 deletions.
22 changes: 7 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1127,12 +1127,6 @@ presets: # Include any other schemas and defined for each alias.
users: ./preset_users.yml # Include the schema with common user data.
db: ./preset_database.yml # Include the schema with basic database columns.

filename_pattern:
preset: users # Take the filename pattern from the preset.

structural_rules: # Take the global rules from the preset.
preset: users

csv:
preset: users # Take the CSV settings from the preset.
enclosure: '|' # Overridden enclosure only for this schema.
Expand Down Expand Up @@ -1176,19 +1170,17 @@ description: This schema contains all the features of the presets.
presets:
# The basepath for the preset is `.` (current directory of the current schema file).
# Define alias "db" for schema in `./preset_database.yml`.
db: preset_database.yml # Or `db: ./preset_database.yml`. It's up to you.
db: preset_database.yml # Or `db: ./preset_database.yml`. It's up to you.

# For example, you can use a relative path.
users: ./../schema-examples/preset_users.yml

# Or you can use an absolute path.
# db: /full/path/preset_database.yml

filename_pattern:
preset: users # Take the filename pattern from the preset.

csv:
preset: users # Take the CSV settings from the preset.
filename_pattern: { preset: users } # Take the filename pattern from the preset.
structural_rules: { preset: users } # Take the global rules from the preset.
csv: { preset: users } # Take the CSV settings from the preset.

columns:
# Use name of column from the preset.
Expand Down Expand Up @@ -1218,14 +1210,14 @@ columns:
# Creating a column from three other columns.
# In fact, it will merge all three at once with key replacement.
- name: Crazy combo!
description: > # Just a great advice.
description: > # Just a great advice.
I like to take risks, too.
Be careful. Use your power wisely.
example: ~ # Ignore inherited "example" value. Set it `null`.
example: ~ # Ignore inherited "example" value. Set it `null`.
preset: 'users/login'
rules:
preset: 'users/email'
not_empty: true # Disable the rule from the preset.
not_empty: true # Disable the rule from the preset.
aggregate_rules:
preset: 'db/0'
```
Expand Down
16 changes: 7 additions & 9 deletions schema-examples/preset_features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@ description: This schema contains all the features of the presets.
presets:
# The basepath for the preset is `.` (current directory of the current schema file).
# Define alias "db" for schema in `./preset_database.yml`.
db: preset_database.yml # Or `db: ./preset_database.yml`. It's up to you.
db: preset_database.yml # Or `db: ./preset_database.yml`. It's up to you.

# For example, you can use a relative path.
users: ./../schema-examples/preset_users.yml

# Or you can use an absolute path.
# db: /full/path/preset_database.yml

filename_pattern:
preset: users # Take the filename pattern from the preset.

csv:
preset: users # Take the CSV settings from the preset.
filename_pattern: { preset: users } # Take the filename pattern from the preset.
structural_rules: { preset: users } # Take the global rules from the preset.
csv: { preset: users } # Take the CSV settings from the preset.

columns:
# Use name of column from the preset.
Expand Down Expand Up @@ -58,13 +56,13 @@ columns:
# Creating a column from three other columns.
# In fact, it will merge all three at once with key replacement.
- name: Crazy combo!
description: > # Just a great advice.
description: > # Just a great advice.
I like to take risks, too.
Be careful. Use your power wisely.
example: ~ # Ignore inherited "example" value. Set it `null`.
example: ~ # Ignore inherited "example" value. Set it `null`.
preset: 'users/login'
rules:
preset: 'users/email'
not_empty: true # Disable the rule from the preset.
not_empty: true # Disable the rule from the preset.
aggregate_rules:
preset: 'db/0'
6 changes: 0 additions & 6 deletions schema-examples/preset_usage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ presets: # Include any other schemas and defined for each alias.
users: ./preset_users.yml # Include the schema with common user data.
db: ./preset_database.yml # Include the schema with basic database columns.

filename_pattern:
preset: users # Take the filename pattern from the preset.

structural_rules: # Take the global rules from the preset.
preset: users

csv:
preset: users # Take the CSV settings from the preset.
enclosure: '|' # Overridden enclosure only for this schema.
Expand Down

0 comments on commit 9a0b46a

Please sign in to comment.