Skip to content

Commit

Permalink
homebrew: support depends_on formula: syntax (OctoLinker#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephfrazier authored Aug 4, 2016
1 parent 30c74ac commit 6cf7c40
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 1 addition & 5 deletions packages/helper-grammar-regex-collection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ const REQUIRE_RESOLVE = /require(?:.resolve)(?:\s|\()(['"][^'"\s]+['"])\)?/g;
const IMPORT = /import [\r\n\s\w{},*\$]*(?: from )?(['"][^'"\s]+['"])/g;
const EXPORT = /export [\r\n\s\w{},*\$]*(?: from )(['"][^'"\s]+['"])/g;
const GEM = /gem (['"][^'"\s]+['"])/g;
// TODO support `formula:` as well. See
// https://github.com/caskroom/homebrew-cask/blob/714bd04bebd195500843dbb2cdbef21d65ff8852/doc/cask_language_reference/stanzas/depends_on.md#depends_on-formula
// Ideally, we'd have a way of knowing which Homebrew tap is referred to, but
// we could just use https://github.com/Homebrew/homebrew-core/
const HOMEBREW = /(?:depends_on|conflicts_with)(?: cask:)? (['"][^'"\s]+['"])/g;
const HOMEBREW = /(?:depends_on|conflicts_with)(?: cask:| formula:)? (['"][^'"\s]+['"])/g;
const TYPESCRIPT_REFERENCE = /\/{3}\s?<reference path=(['"][^'"\s]+['"])/g;
const DOCKER_FROM = /FROM\s([^\n]*)/g;

Expand Down
4 changes: 4 additions & 0 deletions packages/helper-grammar-regex-collection/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ const fixtures = {
['depends_on cask: \'foo\'', ['\'foo\'']],
'conflicts_with cask: "foo"',
['conflicts_with cask: \'foo\'', ['\'foo\'']],
'depends_on formula: "foo"',
['depends_on formula: \'foo\'', ['\'foo\'']],
'conflicts_with formula: "foo"',
['conflicts_with formula: \'foo\'', ['\'foo\'']],
],
// These probably aren't actually invalid, but
// https://github.com/Homebrew/homebrew-core/ has no occurences of multiple
Expand Down

0 comments on commit 6cf7c40

Please sign in to comment.