-
-
Notifications
You must be signed in to change notification settings - Fork 60
Description
Issue summary
While learning how to build a theme, I was taking things from Casper and Source and editing them just to see how things work. The error messages in the sidebar were very helpful, but as I was going through and fixing them I noticed that if a file had a custom theme setting error it would only show the first one.
For example, in my index.hbs I have @custom.demo_prop_on_index_1
and @custom.demo_prop_on_index_2
. Neither actually exist in the config in package.json
, so I'd expect to see an error for both. However, I just see the first one (same for the other files):

When I remove that piece of code and check the scan again, only now do I see the second error:

In addition, in a large file it can be a bit difficult to find where the error is because there's no line number.
Steps to reproduce
- You'll need a theme with files that're using custom theme settings that aren't actually defined in package.json. I created an example here: https://github.com/troyciesco/ghost-skeleton and here's a zip: ghost-skeleton.zip. Basically you want the file(s) to have multiple unknown custom theme setting errors.
- Check the scan using the web tool, directly in a ghost instance, or with
--verbose
in the CLI. You'll only see the first error for each file.- using the CLI without verbose will give you a comma delimited list of files with each file being listed only once, which i think makes sense.
Proposed Solution (see PR)
- Display each error for each file, with a line number showing where the error happened (i.e. "L8")
- ensure the regular CLI version still displays a comma delimited list that only shows each file once
Notes
- Similar things have been talked about a few times (Introduce new groupings for check results #215 and to a lesser extent gscan usage thoughts / suggestion #122). I do like the idea of the file name being listed once and all the errors being nested underneath, but I figured this small improvement was enough to start with.