Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

audit --strict output divided by topic, not formula #44606

Closed
apjanke opened this issue Oct 5, 2015 · 9 comments
Closed

audit --strict output divided by topic, not formula #44606

apjanke opened this issue Oct 5, 2015 · 9 comments

Comments

@apjanke
Copy link
Contributor

apjanke commented Oct 5, 2015

The brew audit --strict check includes a call to brew style to check formula style too. The style check is done as one big style call on all the formulae, before the regular audit checks on each of them. So the style output comes first, other audit results later, and a formula which has both style and regular audit problems will have its results in two places in the output, with other formulae intervening.

I think the results would be more readable if the style check was done for each formula in the main loop, so all the results for a single formula were contiguous in the output. Would you consider a PR to do this? Or is there a reason for breaking all the style results out separately?

head + head do

Also, as an aside, should it be okay for a formula to have both a head line and a head do block? agda does this, and the ordering required by brew audit results in them being split up. Maybe having both head and head do should be another audit complaint?

  head "https://github.com/agda/agda.git", :branch => "master"

  bottle do
    sha256 "2dc343203159551613fa7346a93d3e2931064026dccab6c30b68a8490845643b" => :el_capitan
    sha256 "b5dfadfde1b45ca3d70f2ac812e98a6d72caf1d840d4cb9c4eee95e81d74ff0b" => :yosemite
    sha256 "4513aecea2fbf5d1a682e04e4cccfd795d48836bcf1b16f79c24fa3bd6482854" => :mavericks
    sha256 "d0e17808ee896cdedc499b010b67961dc3db3c430c501faef16c4b4482238447" => :mountain_lion
  end

  head do
    resource "stdlib" do
      url "https://github.com/agda/agda-stdlib.git", :branch => "master"
    end
  end
@bfontaine
Copy link
Contributor

should it be okay for a formula to have both a head line and a head do block?

No, it should have only a head do block.

@apjanke
Copy link
Contributor Author

apjanke commented Oct 5, 2015

Want to add a test in audit for it?

$ brew audit --strict agda
==> brew style agda

1 file inspected, no offenses detected

==> audit problems
agda:
 * `head` (line 20) should be put before `bottle block` (line 13)
 * `head block` (line 34) should be put before `option` (line 22)
 * Should not have both `head` and `head do`

Error: 3 problems in 1 formula

https://github.com/apjanke/homebrew/tree/two-heads-are-for-mutants

@bfontaine
Copy link
Contributor

Yes that’d be great. Nice branch name 😄

@apjanke
Copy link
Contributor Author

apjanke commented Oct 5, 2015

Okay, does that branch look ready to turn in to a PR?

@bfontaine
Copy link
Contributor

Yep 👍

@apjanke
Copy link
Contributor Author

apjanke commented Oct 5, 2015

PR away: #44626

@bfontaine
Copy link
Contributor

I think the results would be more readable if the style check was done for each formula in the main loop, so all the results for a single formula were contiguous in the output. Would you consider a PR to do this? Or is there a reason for breaking all the style results out separately?

There’s no reason for that; it’s a great idea to merge the outputs.

@DomT4
Copy link
Member

DomT4 commented Oct 9, 2015

Happy to review a PR for merging the output as well.

@DomT4 DomT4 closed this as completed Oct 9, 2015
@apjanke
Copy link
Contributor Author

apjanke commented May 3, 2016

Finally got a fix for the whole audit arrangement done in Homebrew/brew#112. It's merged now.

@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants