9 Commits

Author SHA1 Message Date
Issy Long
6de61e4994
Ensure that stanza grouping works for nested stanzas with comments
- Since moving `comments_hash` to `Stanza`, we've been using the wrong
  kind of "comments": the comments for the _stanza_, not the comments
  for the entire Cask.
- Add a test to ensure this actually works. There was previously an
  infinite loop here due to the bad `comments`, visible in a `StanzaOrder`
  cop test, which I speculatively added a failing test for. Turns out
  that supporting nested stanza _ordering_ (vs. just grouping) is a
  whole separate piece of work (there are multiple TODOs there already),
  so I've backed that out and will do that separately.
2023-04-13 15:59:18 +01:00
Issy Long
10bdb9f653
Don't pass cask_node into Stanza, stanza_node.parent is enough 2023-04-12 20:46:23 +01:00
Issy Long
519c1b46d8
In-line converting nodes to stanzas; move comment detection to Stanza
- Since comment detection is only used in `Stanza`, move it there.
- The `stanzaify` method was only in `CaskBlock` since the other use of
  `Stanza.new` was. Since it's only used in one other place, move it to
  where it's used.
2023-04-12 20:46:22 +01:00
Issy Long
233db299cd
rubocop/cask: Check for correct stanza grouping within on_* blocks
- A variant of this was an ancient TODO from 2018 (with `if/else` blocks).
- Now in 2023 we have `on_*` blocks within Casks that are very common.
- The most common stanzas present inside `on_*` blocks are `version`,
  `sha256` and `url`. So I feel like it's worth keeping a consistent
  style for these inside and outside `on_*` blocks.
2023-04-12 20:46:20 +01:00
Markus Reiter
3c89f99df1
Fix toplevel_stanzas. 2023-03-21 14:43:59 +01:00
Rylan Polster
3f00893201
Include on_{system} blocks as stanzas in rubocop 2022-08-23 14:09:29 -04:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
491ceb6c4c
Import rubocop-cask (with clean brew style) 2018-11-08 15:54:46 +00:00