Skip to content
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

Report file name when slim encounters compilation errors #1175

Merged
merged 1 commit into from May 7, 2017
Merged

Report file name when slim encounters compilation errors #1175

merged 1 commit into from May 7, 2017

Conversation

@agross
Copy link
Contributor

@agross agross commented May 5, 2017

Detailed description

When slim reports errors it currently looks like this:

Slim::Parser::SyntaxError: Expected attribute
  (__TEMPLATE__), Line 16, Column 13
  | id: 'webpage-description' }

It can be hard to find the offending file, so pass filename to slim to have errors reported like so:

Slim::Parser::SyntaxError: Expected attribute
  layout /default.slim, Line 16, Column 13
    | id: 'webpage-description' }

To do

  • Review test (it's my first minitest spec)
@ddfreyne
Copy link
Member

@ddfreyne ddfreyne commented May 6, 2017

Looks good so far!

As for the failing test,

      assigns = {
        layout: layout
      }

needs to become

      assigns = {
        layout: layout,
      }

(trailing comma), or

      assigns = { layout: layout }

Loading

@agross
Copy link
Contributor Author

@agross agross commented May 7, 2017

Reviewed, thanks. I wasn't even aware of the style error as the VS Code rubocop plugin (which uses rubocop 0.48.1) reports this for .rubocop.yml:

Layout/IndentArray has the wrong namespace - should be Style

Loading

@ddfreyne ddfreyne merged commit ed3a19a into nanoc:master May 7, 2017
3 checks passed
Loading
@ddfreyne
Copy link
Member

@ddfreyne ddfreyne commented May 7, 2017

Thanks!

I’ll look into .rubocop — some cops have changed namespaces recently.

Loading

@ddfreyne
Copy link
Member

@ddfreyne ddfreyne commented May 8, 2017

…the VS Code rubocop plugin (which uses rubocop 0.48.1) reports this for .rubocop.yml:

Layout/IndentArray has the wrong namespace - should be Style

That’s odd—the .rubocop.yml file does not even mention IndentArray!

Loading

@ddfreyne
Copy link
Member

@ddfreyne ddfreyne commented May 8, 2017

Oops, my bad—take a look at rubocop/rubocop/pull/4278, which changes the namespace from Style to Layout. I’m using Rubocop from GitHub, so I suppose that’s the reason!

Loading

@agross agross deleted the slim-error-report-filename branch May 8, 2017
@agross
Copy link
Contributor Author

@agross agross commented May 8, 2017

I’m using Rubocop from GitHub

I think so. I'm using the packed gem, works for me without issues.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants