-
Notifications
You must be signed in to change notification settings - Fork 178
Fix config.yml template indentation #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Oh! I can't reproduce this one. Is it possible you left the first line:
commented-out? |
I see this file: #default: &default
# dispatchers:
# - polling_interval: 1
# batch_size: 500
# workers:
# - queues: "*"
# threads: 5
# processes: 1
# polling_interval: 0.1
#
# development:
# <<: *default
#
# test:
# <<: *default
#
# production:
# <<: *default If I remove the default: &default
dispatchers:
- polling_interval: 1
batch_size: 500
workers:
- queues: "*"
threads: 5
processes: 1
polling_interval: 0.1
development:
<<: *default
test:
<<: *default
production:
<<: *default Which fails with:
So that's problem 1. Problem 2 is that the Problem 3 is that the default indentation has one extra space (3 instead of 2) |
Oh! I just realised the real issue is the missing space before diff --git a/lib/generators/solid_queue/install/templates/config.yml b/lib/generators/solid_queue/install/templates/config.yml
index 9c1856a..7270d0a 100644
--- a/lib/generators/solid_queue/install/templates/config.yml
+++ b/lib/generators/solid_queue/install/templates/config.yml
@@ -1,4 +1,4 @@
-#default: &default
+# default: &default
# dispatchers:
# - polling_interval: 1
# batch_size: 500 |
@rosa ya. Looks like adding that one space back allows It still shows an extra leading space for me when I use https://github.com/tpope/vim-commentary but it's easy enough for me to remove. Which patch do you prefer? |
I prefer the second one; I think it looks nicer with the space after |
Prior to this change, if all #'s are removed from the config template you're left with a yaml file that solid_queue can't parse. ``` bundle exec rake solid_queue:start rake aborted! YAML syntax error occurred while parsing /Users/anthonyross/projects/mint/config/solid_queue.yml. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Error: (<unknown>): did not find expected key while parsing a block mapping at line 1 column 1 ``` reproducable in this repo via (remove comments first). After fix: ``` ActiveSupport::ConfigurationFile.parse("./lib/generators/solid_queue/install/templates/config.yml")["development"] => {"batch_size"=>10, "dispatchers"=>[{"polling_interval"=>1, "batch_size"=>500}], "workers"=>[{"queues"=>"*", "threads"=>5, "processes"=>1, "polling_interval"=>0.1}]} ```
62a4646
to
96388a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much!
Prior to this change, if all #'s are removed from the config template you're left with is a yaml file that solid_queue can't parse.
reproducable in this repo via (remove comments first). After fix: