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

Conversation

Projects
None yet
2 participants
@agross
Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

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 }
@agross

This comment has been minimized.

Copy link
Contributor Author

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

@ddfreyne ddfreyne merged commit ed3a19a into nanoc:master May 7, 2017

3 checks passed

codecov/patch 100% of diff hit (target 98.69%)
Details
codecov/project 98.69% (+<.01%) compared to 0fdea40
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ddfreyne

This comment has been minimized.

Copy link
Member

commented May 7, 2017

Thanks!

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

@ddfreyne

This comment has been minimized.

Copy link
Member

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!

@ddfreyne

This comment has been minimized.

Copy link
Member

commented May 8, 2017

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

@agross agross deleted the agross:slim-error-report-filename branch May 8, 2017

@agross

This comment has been minimized.

Copy link
Contributor Author

commented May 8, 2017

I’m using Rubocop from GitHub

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.