Skip to content
This repository was archived by the owner on Jan 19, 2026. It is now read-only.

Show error to tell developer they added a styleguide block for an undefined section - #18

Merged
dewski merged 2 commits into
dewski:masterfrom
jankeesvw:throw-error-when-style-is-missing
Feb 14, 2013
Merged

dewski merged 2 commits into
dewski:masterfrom
jankeesvw:throw-error-when-style-is-missing

Conversation

@jankeesvw

Copy link
Copy Markdown

This pull request adds an error when a developer adds a section that isn't defined in css yet. I've had this question several times in my team.

Undefined styleguide element

Comment thread app/helpers/kss/application_helper.rb Outdated

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind having inline unless conditionals on shorter statements, but let's just wrap this with an if:

if !@section.raw
  raise "KSS styleguide section is nil, is section: '#{section}' defined in your css?"
end

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine with me.

@dewski

dewski commented Feb 12, 2013

Copy link
Copy Markdown
Owner

I know I've ran into this myself, so good idea! Just the one tiny comment and I'll :shipit:

dewski pushed a commit that referenced this pull request Feb 14, 2013
Show error to tell developer they added a styleguide block for an undefined section
@dewski
dewski merged commit 048ed7e into dewski:master Feb 14, 2013
@jankeesvw

Copy link
Copy Markdown
Author

hey @dewski I fixed the code 👍

@jankeesvw

Copy link
Copy Markdown
Author

Thanks, that's fast ⏩ ⏩

@jankeesvw
jankeesvw deleted the throw-error-when-style-is-missing branch February 14, 2013 20:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants