Git Product home page Git Product logo

hound's Introduction

Hound

Build Status codebeat Reviewed by Hound

This codebase is the Rails app for Hound, a hosted service that reviews GitHub pull requests for style guide violations.

Supported languages:

  • Bash
  • Elixir
  • Go
  • HAML
  • JavaScript
    • CoffeeScript
    • TypeScript
  • Markdown
  • PHP
  • Python
  • Ruby
    • ERB
  • Sass / SCSS
  • Swift

Note: When Hound has nothing to check, it reports a successful status.

If you have any questions about the service, see Help or email us at [email protected].

To contribute to the Hound codebase, see the CONTRIBUTING.md file.

License

The names and logos for Hound are trademarks of Hound Group LLC

Hound is Copyright © 2012-2018 Hound Group LLC. It is free software, and may be redistributed under the terms specified in the LICENSE file.

hound's People

Contributors

arunagw avatar bernerdschaefer avatar blackjid avatar c-lliope avatar calebhearth avatar camelmasa avatar dependabot-support avatar dependabot[bot] avatar donokuda avatar ehmorris avatar frechg avatar gylaz avatar jakecraige avatar jayroh avatar jferris avatar juanitofatas avatar koronen avatar mike-burns avatar reshleman avatar richrines avatar salbertson avatar sardaukar avatar seanpdoyle avatar sikachu avatar smharley avatar srt32 avatar teoljungberg avatar thorncp avatar tomasbarry avatar tysongach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hound's Issues

Provide full RuboCop config

I would like to be able to run RuboCop against my project with the same configuration as Hound. Please provide a full RuboCop config that matches the config of Hound.

Where is the default config file?

According to the configuration of hound:

By default, Hound uses THOUGHTBOT'S STYLE GUIDE with no additional setup.

Custom configuration of the style guide is entirely optional and is achieved by specifying rules in .hound.yml file.

Hound uses RUBOCOP gem to handle the style checking. Thus, most of the RuboCop configuration, except inheritance, is supported in Hound as well.

Hound will look for .hound.yml file in the root of the repo, and apply the custom configuration on top of the default configuration.

I know hound doesn't use the default rubocop styles but thoughtbot's styles. However, I can't find that default configuration file. I would like to know what it is, so that it is easier for me to understand where your styleguide and mine differ.

Can you point me to where the config exists? I can't seem to find it in source.

Not in style guide: Use do end instead for multiline blocks in spec

We have delimiters in a spec and hound is complaining but we can't use do & end.

  it {
    should delegate_method(:default_variant_name).
      to(:default_variant).
      as(:name)
  }

Avoid using {...} for multi-line blocks.

I think this behaviour is not what we want in cases like the one above.

Add houndci always into team Services for the organization

Currently @houndci will join the first team that the enabled repository is a part of. I don't think this is necessary and I strongly believe that it is a much better approach if @houndci would create the "Services" team and join it at all times. (I mean why bother? Especially when there are multiple teams, it gets tricky.)

By the way, what happens if there is already team named "Services"?

Thank you,

Bigger that 1MB files in pull request

There is a problem when in pull request have file which is bigger than 1 MB file.
Then Resque is failing and all other comments on Pull Request are skipping too..

Error

Octokit::Forbidden
Error
GET: 403 - This API returns blobs up to 1 MB in size.The requested blob is
too large to fetch via the API, but you can use the Git Data API to request blobs
up to 100 MB in size. Error summary: resource: Blob field: data code: too_large
// See: https://developer.github.com/v3/repos/contents/#get-contents

Solution

We can rescue that error to skip those big files and keep checking other files.

path/to/project/lib/github_api.rb:75:in `file_contents'
path/to/project/app/models/pull_request.rb:62:in `file_contents'
path/to/project/app/models/pull_request.rb:58:in `build_commit_file'
path/to/project/app/models/pull_request.rb:19:in `block in pull_request_files'
path/to/project/app/models/pull_request.rb:18:in `map'
path/to/project/app/models/pull_request.rb:18:in `pull_request_files'

Full featured website, not only github comments

Hi guys, I had similar idea and I'm very happy you made it.
I was planning to make it a full featured service like :

Keep the full history on the website, browse the files, statistics, badges, scores ...
Github comments was an option you can switch on/off.

Do you have similar vision for the future of the project or you just want to stick with Github comments?

I am interested in contributing ;)

Named arguments and space after colon violation

Hound reported that a "space missing after colon" when working with a Ruby 2.1 required named argument.

For example:

def fill_in_coupon_form(attributes, course_name:, value:, type:)

Hound wanted

def fill_in_coupon_form(attributes, course_name: , value:, type:)

Is this violation intended? It seems like it makes sense for Ruby 1.9 hash syntax but doesn't seem to apply here for named arguments. Not sure if theres a way to even differentiate between the 2 though.

What's required for Hound to see repos within an organization?

Hi,

I find that hound can't see my repos that are within an organization. I've tried to enable all scopes of the oauth token used by the hound user but it still can't find them. Do I must be the owner of the repos for hound to find them?

Any help would be appreciated!
Thanks

Default style guide: "Rename has_something? to something?."

There isn't anything in our style guide about this, but Hound is leaving these comments:

Rename has_solutions_by_other_users? to solutions_by_other_users?.

This is annoying, because renaming as suggested would break RSpec predicate matchers like expect(review).to have_solutions_by_other_users.

Hound doesn't seem to respect Exclude filters

If I run Rubocop on the CL, things are evaluated as expected, but Hound continues to yell at many of my PR's.

The parts of my .hound.yml of interest:

AllCops:
  RunRailsCops: true
  Exclude:
    - 'bin/**/*'
    - 'config/environments/**/*'
    - 'config/initializers/devise.rb'
    - 'db/**/*'
    - 'vendor/**/*'

IndentationConsistency:
  Exclude:
    - '**/factories/**/*'

IndentationWidth:
  Exclude:
    - '**/factories/**/*'

RedundantSelf:
  Exclude:
    - '**/models/**/*'

Multiple violation messages

If violation happens multiple times on the same line, then Hound will print out the violation message multiple times.

screen shot 2014-03-21 at 9 40 09 am

Probably makes the most sense to display the message once.

make it easier to determine from hound comments which rubocop settings trigger them

This seems to be a consistent pattern:

  • one person on the team adds houndci to a project
  • PRs get a bunch of notifications about line length and block spacing that some people disagree with
  • said people can't immediately figure out how to edit .hound.yml to disable those validations
  • said people get frustrated and remove houndci entirely

It would be nice if hound comments (optionally) started with the yml keys of the relevant rubocop rules (e.g. LineLength: Limit lines to 80 characters.) or could be linked to them in some convenient way. That would make it easier for developers to determine which options to add (or omit) from the yml file.

This suggestion is entirely pragmatic; I don't think the frustration I've seen with hound is really warranted, but I think you will have more users and do more good in the world if disabling hound messages for particular style violations is easier/more intuitive.

private in prefix notation gives indentation warnings

the following triggers an incorrect warning:

private def foo
  bar
end

It says that bar should be indented 2 spaces, not -6 (minus six). It seems to count starting from def, but it should start from the start of the statement.

An exception for 'private' wouldn't be enough. For instance:

before_filter def foo
  bar
end

Local Failing Test

With a fresh install I'm getting a local failing test.

Failures:

  1) Repo list user signs up
     Failure/Error: expect(page).to have_content I18n.t('syncing_repos').upcase
       expected to find text "LOADING REPOS..." in "HOUNDREPOS GITHUB17 ACTIVE REPOS: OF REFRESH REPO LIST"
     # ./spec/features/repo_list_spec.rb:53:in `block (3 levels) in <top (required)>'
     # ./spec/features/repo_list_spec.rb:129:in `with_job_delay'
     # ./spec/features/repo_list_spec.rb:48:in `block (2 levels) in <top (required)>'

Finished in 8.64 seconds
188 examples, 1 failure, 9 pending

Idea: Store config in guides

We're in a situation now where adding a new style guideline means:

  1. Opening a pull request to guides.
  2. Waiting a week for discussion.
  3. Merging the pull request.
  4. Opening a pull request to hound.
  5. Reviewing, merging, and deploying that pull request.

In between steps 3 and 5, we get comments from Hound which conflict with our style guide.

It would be nice if:

  • We had a config file in the guides repo.
  • We could point Hound to it as our default config.
  • Hound would somehow fetch updates for that config.

This way, we could update the config as part of pull requests which change the style guidelines. The guides and Hound will never be out of sync.

Hound not picking up changes in .hound.yml

We are using an older version of ruby and noticed that when we changed the .hound.yml file to:

Style/HashSyntax:
  EnforcedStyle: hash_rockets

It still was using the ruby19 supported style. What gives?

Not in style guide: Use 2 spaces for indentation in a hash, relative to the first position after the preceding left parenthesis.

I've seen the following message a few times, related to method calls that were wrapped like this:

some_method(foo: {
  bar: 1, # Hound comments on this line
  baz: 2,
})

It looks like rubocop wants this:

some_method(foo: {
              bar: 1,
              baz: 2,
            })

This seems to go against a couple of guidelines:

  • Don't vertically align tokens on consecutive lines.
  • Indent continued lines two spaces.

PHP?

I see a pull request for coffee-lint. Would you guys be interested in other languages such as PHP? I had an idea to do this for PHP and created a little demo app that is working for a private repo, but this repo is much more extensive and well rounded I'd much rather enable it here then start my own repo or have a diverged fork. Lemme know what you guys think!

Ignore Params Style Checking

This could just be me, but I think we should ignore style checking params globally. There are several api's that use camelCase instead of snake case and its weird we are validating styles for incoming parameters.

I can see an argument being made for both sides but its a layer of polish imo.

screen shot 2014-04-04 at 11 37 12 am

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.