GithubHelp home page GithubHelp logo

inch's People

Contributors

cbeer avatar dcarral avatar dideler avatar jfelchner avatar jimjeffers avatar michaelherold avatar olleolleolle avatar orta avatar rrrene avatar spk avatar yous 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

inch's Issues

inch terminates with exception

Backtrace

/home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/language/ruby/provider/yard/object/method_object.rb:162:in `block in return_described_via_tag?': undefined method `empty?' for nil:NilClass (NoMethodError)
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/language/ruby/provider/yard/object/method_object.rb:160:in `each'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/language/ruby/provider/yard/object/method_object.rb:160:in `any?'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/language/ruby/provider/yard/object/method_object.rb:160:in `return_described_via_tag?'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/language/ruby/provider/yard/object/method_object.rb:86:in `return_described?'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/code_object/converter.rb:75:in `public_send'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/code_object/converter.rb:75:in `block in to_hash'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/code_object/converter.rb:73:in `each'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/code_object/converter.rb:73:in `to_hash'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/code_object/proxy.rb:14:in `for'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/codebase/object.rb:32:in `initialize'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/codebase/objects.rb:19:in `new'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/codebase/objects.rb:19:in `block in initialize'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/codebase/objects.rb:18:in `map'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/codebase/objects.rb:18:in `initialize'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/codebase/proxy.rb:7:in `new'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/codebase/proxy.rb:7:in `initialize'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/codebase/proxy.rb:12:in `new'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/codebase/proxy.rb:12:in `parse'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/codebase.rb:12:in `parse'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/cli/command/base_list.rb:24:in `prepare_codebase'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/cli/command/suggest.rb:24:in `run'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/cli/command/base.rb:50:in `run'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/cli/command_parser.rb:99:in `run_command'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/cli/command_parser.rb:62:in `run'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/lib/inch/cli/command_parser.rb:52:in `run'
        from /home/doudou/dev/flat_fish/.gems/gems/inch-0.6.3/bin/inch:23:in `<top (required)>'
        from /home/doudou/dev/flat_fish/.gems/bin/inch:23:in `load'
        from /home/doudou/dev/flat_fish/.gems/bin/inch:23:in `<main>'

I would happily try to isolate the file that triggers the bug ... but is there a way to trace what inch is doing ?

Must require inch/cli explicitly for inch/rake

Please consider my brevity here a placeholder for further investigation once I have a bit more time. With the newest version of Inch (0.4.7 at time of writing), it would seem that I need to require things in my Rakefile as follows in order to avoid an undefined constant error for Inch::CLI:

require 'inch'
require 'inch/cli'
require 'inch/rake'

Granted, this is with require 'bundler/setup' in use in the Rakefile as well.

Here was the non-working Rakefile and Gemfile (verified to still have the issue with only bundler/setup and inch/rake required:

Rakefile

require 'bundler/setup'
require 'bundler/gem_tasks'
require 'inch/rake'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'yard/rake/yardoc_task'

namespace :lint do
  desc 'Lint inline documentation'
  Inch::Rake::Suggest.new(:docs)

  desc 'Lint code style'
  RuboCop::RakeTask.new(:ruby)
end

desc 'Run all linters'
task lint: %w(lint:ruby lint:docs)

desc 'Run all tests'
RSpec::Core::RakeTask.new(:spec)

desc 'Generate documentation'
YARD::Rake::YardocTask.new

task default: %i(lint spec)

Gemfile

source 'https://rubygems.org'

gemspec

group :development do
  gem 'overcommit', '~> 0.16'
  gem 'rails', '~> 4.1'
  gem 'rake', '~> 10.3'
end

group :lint do
  gem 'inch', '~> 0.4'
  gem 'rubocop', '~> 0.24'
end

group :test do
  gem 'coveralls', '~> 0.7', require: false
  gem 'rspec', '~> 3.0'
  gem 'webmock', '~> 1.18', require: false
end

group :debugger do
  gem 'pry-byebug', '~> 1.3'
end

group :docs do
  gem 'github-markup', '~> 1.2'
  gem 'redcarpet', '~> 3.1'
  gem 'yard', github: 'lsegal/yard'
end

Cheers once again for a great tool!

Inch failing to create page

Inch web is failing to build my ruby gem (dtg). I have attached screenshots of the pages I navigated through. I added inch to my GitHub as well by signing in with it. Also, forgot to add, one of my other inch builds for dtg built for well over 3000 seconds before I accidentally closed the browser and I realized I did not have the link anymore.

https://github.com/optimizasean/dtg

(only have one branch: master)

I just made this project for myself and a few others and saw how much trouble it was and figured I would put it open source so others could benefit from it as well. I really want to get the badge and data to help me assess documentation. Thanks!

Sync Page
Build List
Inch Builds

Problem with branches

When I evaluate "pprzetacznik/IElixir" project on this site: http://inch-ci.org, I can see some tips about how I can configure project to make it work with Inch CI.

On the right there's a switch with "branch: master" and when I change branch to "feature/inch-ci" I see error page with following message:

The page you were looking for doesn't exist.

You may have mistyped the address or the page may have moved.

If you are the application owner check the logs for more information.

http://inch-ci.org/github/pprzetacznik/IElixir/branch/feature/inch-ci

RDoc support

Hi,

just wanted to test this tool but I found that it doesn't really support RDoc. It seems to always use Yard for getting the data, there is no way to use RDoc, at least I didn't find any CLI option. (Yard throws an error when used on my codebase, so that's not really helpful -- but that's is naturally not the problem of inch).

Please consider adding real RDoc support - thanks!

Cheers,
Thomas

Consider renaming the project

When I search Google for "ruby inch doc", I get some "interesting" results. You might want to consider renaming the project to avoid that issue for people looking for your project.

exception on initial use

Both on centos 5.8 and OSX 10.9 (both using rvm + ruby 1.9.3)

$ inch lib/

.rvm/gems/ruby-1.9.3-p429-perf/gems/inch-0.4.6/lib/inch/utils/ui.rb:64:in __header': undefined methodon_color' for #String:0x0000001829e128 (NoMethodError)
from .rvm/gems/ruby-1.9.3-p429-perf/gems/inch-0.4.6/lib/inch/utils/ui.rb:47:in header' from .rvm/gems/ruby-1.9.3-p429-perf/gems/inch-0.4.6/lib/inch/cli/command/output/suggest.rb:82:inblock in display_list'
from .rvm/gems/ruby-1.9.3-p429-perf/gems/inch-0.4.6/lib/inch/cli/command/output/suggest.rb:77:in map' from .rvm/gems/ruby-1.9.3-p429-perf/gems/inch-0.4.6/lib/inch/cli/command/output/suggest.rb:77:indisplay_list'
from .rvm/gems/ruby-1.9.3-p429-perf/gems/inch-0.4.6/lib/inch/cli/command/output/suggest.rb:35:in initialize' from .rvm/gems/ruby-1.9.3-p429-perf/gems/inch-0.4.6/lib/inch/cli/command/suggest.rb:26:innew'
from .rvm/gems/ruby-1.9.3-p429-perf/gems/inch-0.4.6/lib/inch/cli/command/suggest.rb:26:in run' from .rvm/gems/ruby-1.9.3-p429-perf/gems/inch-0.4.6/lib/inch/cli/command/base.rb:49:inrun'
from .rvm/gems/ruby-1.9.3-p429-perf/gems/inch-0.4.6/lib/inch/cli/command_parser.rb:98:in run_command' from .rvm/gems/ruby-1.9.3-p429-perf/gems/inch-0.4.6/lib/inch/cli/command_parser.rb:61:inrun'
from .rvm/gems/ruby-1.9.3-p429-perf/gems/inch-0.4.6/lib/inch/cli/command_parser.rb:51:in run' from .rvm/gems/ruby-1.9.3-p429-perf/gems/inch-0.4.6/bin/inch:22:in<top (required)>'
from .rvm/gems/ruby-1.9.3-p429-perf/bin/inch:23:in load' from .rvm/gems/ruby-1.9.3-p429-perf/bin/inch:23:in

'
from .rvm/gems/ruby-1.9.3-p429-perf/bin/ruby_executable_hooks:15:in eval' from .rvm/gems/ruby-1.9.3-p429-perf/bin/ruby_executable_hooks:15:in'

Inch does not recognize YARD macros

This might be a problem:

One piece of feedback: I'm noticing that inches considers somethings undocumented that actually are documented. For example, Our various matcher alises in rspec-expectations are listed as undocumented:

http://inch-pages.github.io/github/rspec/rspec-expectations/

...but they are documented properly as aliases:

http://rubydoc.info/github/rspec/rspec-expectations/RSpec/Matchers

see also: https://github.com/rspec/rspec-expectations/blob/2c5c8cde7ff956803dd1a3aa1ae0d88cd9d2a1e1/lib/rspec/matchers.rb#L248

via rspec/rspec-support#53 (comment)

Incredibly tight runtime dependency requirement

I'd like to use this gem in the same Gemfile with puppet-strings, but due to Inch's incredibly thight requirement

spec.add_dependency 'yard', '~> 0.8.7.5'

Bundler returns

Bundler could not find compatible versions for gem "yard":
  In Gemfile:
    inch (~> 0.7) was resolved to 0.7.1, which depends on
      yard (~> 0.8.7.5)

    puppet-strings (~> 1.1) was resolved to 1.1.1, which depends on
      yard (~> 0.9.5)

The only viable version of Inch to go with puppet-strings v1 would be Inch 0.0.1.

Fix Ruby warnings

There are several warnings given by the Ruby interpreter when running Inch on the latest couple of Ruby versions:

/Users/rene/projects/inch/config/base.rb:49: warning: ambiguous first argument; put parentheses or a space even after `-' operator
/Users/rene/projects/inch/test/integration/cli/command/console_test.rb:4: warning: method redefined; discarding old run_pry
/Users/rene/projects/inch/lib/inch/cli/command/output/console.rb:53: warning: previous definition of run_pry was here

Rake Task problems

I add the Raketask as followed:

require 'inch/rake'

Inch::Rake::Suggest.new

This leads to the following error:

rake aborted!
uninitialized constant Inch::Rake::Suggest::CLI
/Users/moonglum/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/Users/moonglum/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => inch
(See full trace by running task with --trace)

I fixed it by also requiring inch. But that leads to a warning:

/Users/moonglum/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/inch-0.3.2/lib/inch/evaluation/proxy/base.rb:8: warning: already initialized constant Inch::Evaluation::Proxy::Base::MIN_SCORE
/Users/moonglum/.rvm/gems/ruby-2.1.1/gems/inch-0.3.2/lib/inch/evaluation/proxy/base.rb:8: warning: previous definition of MIN_SCORE was here
/Users/moonglum/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/inch-0.3.2/lib/inch/evaluation/proxy/base.rb:9: warning: already initialized constant Inch::Evaluation::Proxy::Base::MAX_SCORE
/Users/moonglum/.rvm/gems/ruby-2.1.1/gems/inch-0.3.2/lib/inch/evaluation/proxy/base.rb:9: warning: previous definition of MAX_SCORE was here
/Users/moonglum/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/inch-0.3.2/lib/inch/evaluation/proxy/base.rb:11: warning: already initialized constant Inch::Evaluation::Proxy::Base::TAGGED_SCORE
/Users/moonglum/.rvm/gems/ruby-2.1.1/gems/inch-0.3.2/lib/inch/evaluation/proxy/base.rb:11: warning: previous definition of TAGGED_SCORE was here

I'm using the currently released version 0.3.2 of inch.

Inch doesn't seem to analyze well a simple repository

Hello, first of all thanks for this good idea.

I recently added my repository to the list, but it didn't seem to get on very well, it reported I had well documented quite a lot of methods, when the only thing I have are specs.

For example:

http://inch-pages.github.io/github/kshmir/fields/
https://raw.githubusercontent.com/kshmir/fields/master/lib/fields/schema/differ.rb

There are comments on some of those lines, but most of them are not relevant or documentation at all.

I hope my feedback is helpful

Inch doesn't seem to be finding any objects in my repo

Hello! I'm setting up Inch for several new projects and noticed that for a couple of them, it doesn't seem to be finding any objects.

Here's an example of one that's working fine:

For commandsy-rb Inline docs:

commandsy-rb $ bundle exec inch list --no-color

# Seems really good

┃  A  ↗  Commandsy

# Undocumented

┃  U  ↘  Commandsy::VERSION

For commandsy-dev Inline docs:

commandsy-dev $ bundle exec inch list lib/**/*.rb --all
(No output)

For commandsy-dev, there should at least be the Commandsy::Dev, Commandsy::Dev::CLI, and Commandsy::Dev::VERSION in that list, with Commandsy::Dev and Commandsy::Dev::CLI listed as documented and Commandsy::Dev::VERSION undocumented.

Here's the .yardopts files from each project as well, if these are relevant:

commandsy-rb/.yardopts

--charset utf-8
--embed-mixin ClassMethods
--markup-provider redcarpet
--markup markdown
--no-private
--quiet
--protected
--readme README.md
lib/**/*.rb
-
CHANGELOG.md
CONTRIBUTING.md
DEVELOPMENT.md
LICENSE

commandsy-dev/.yardopts

--charset utf-8
--embed-mixin ClassMethods
--markup-provider redcarpet
--markup markdown
--no-private
--quiet
--protected
--readme README.md
lib/**/*.rb
-
CHANGELOG.md
CONTRIBUTING.md
DEVELOPMENT.md
LICENSE

I'm not sure what I may have done differently between these projects for Inch not to be able to find anything for commandsy-dev. If you need any more info about the problem, please let me know. The same issue is also happening for the commandsy-plugin-rb repository.

Support for puppet modules

Hey,

Is there a way to support puppet modules? They use loots of Ruby code and manifests (*.pp files) is kinda rdoc style. Take a look at my module: https://github.com/wavesoftware/puppet-xtreemfs

I think that inch dosent understand Puppet's dynamic types and providers initalization. There is no standard ruby: module Aaa::Bbbb or class Ccc but dynamic:

Puppet::Type.type(:xtreemfs_volume).provide :xtreemfs do
  desc "Manages xtreemfs_volume of a logical volume"

  commands :mkfs_xtreemfs => 'mkfs.xtreemfs'
  commands :lsfs_xtreemfs => 'lsfs.xtreemfs'
  commands :rmfs_xtreemfs => 'rmfs.xtreemfs'

  # A constructor
  #
  # @param value [Hash] values for the provider, prefeched
  # @return [Puppet::Type::Xtreemfs_volume::Xtreemfs]
  def initialize value = {}

And here is a manifest doc:

# == Manages an mount of XtreemFS volume
#
# You can create and destroy mount points for XtreemFS volumes. By default it will also add an entry to system fstab, so that mount point will be active at boot time.
#
# === Parameters:
#
# [*mountpoint*]
#     (namevar) A directory to became a mount point
# [*volume*]
#     A name of volume that is active in directory service
# [*ensure*]
#     Standard ensure property. Can be: +mounted+, +unmounted+ (same as +present+) or +absent+
# [*dir_service*]
#     A hostname of directory service
# [*atboot*]
#     Should this mount be active also at boot time? If +true+, it will be added to system +/etc/fstab+
# [*options*]
#     Mount options for the mounts, as they would appear in the fstab.
#
define xtreemfs::mount (
  $volume,
  $mountpoint  = $name,
  $ensure      = 'mounted',
  $dir_service = undef,
  $atboot      = true,
  $options     = 'defaults,allow_other',
) {

No support for @!attribute directive

The @!attribute directive in YARD provides documentation for two methods internally, a getter and a setter. It doesn't actually display either of those methods in the doc output -- rather, it displays them in a special "Instance Attribute Details" section.

Inch reports that there is documentation for the getter, but that there is not documentation for the setter, which yields a whole bunch of bogus undocumented method reports in my Inch data. Any way we could get a fix? Thanks!

YARD `@overload` not taken into account

inch ignores @overload, and does not see the documentation at all, resulting in a bad score.

For example, this piece of code:

    # @overload identifiers(*identifiers)
    #
    #   Sets the identifiers for this class.
    #
    #   @param [Array<Symbol>] identifiers A list of identifiers to assign to
    #     this class.
    #
    #   @return [void]
    #
    # @overload identifiers
    #
    #   @return [Array<Symbol>] The identifiers for this class
    def identifiers(*identifiers)
      if identifiers.empty?
        DDPlugin::Registry.instance.identifiers_of(root_class, self)
      else
        DDPlugin::Registry.instance.register(root_class, self, *identifiers)
      end
    end

… has this output:

# DDPlugin::Plugin#identifiers                                                                                                                                 
┃ -> /Users/ddfreyne/Documents/Development/ddplugin/lib/ddplugin/plugin.rb:22
┃ -------------------------------------------------------------------------------------------------------------------------------------------------------------
┃ Grade: C - Needs work
┃ -------------------------------------------------------------------------------------------------------------------------------------------------------------
┃ + Add a comment describing the method
┃ + Add a code example (optional)
┃ + Describe what 'identifiers' returns
┃ + Describe what 'identifiers' returns
┃ + Describe the parameter 'identifiers'
┃ -------------------------------------------------------------------------------------------------------------------------------------------------------------

Fix warnings about constants being changed

First reported in #7

I fixed it by also requiring inch. But that leads to a warning:

/Users/moonglum/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/inch-0.3.2/lib/inch/evaluation/proxy/base.rb:8: warning: already initialized constant Inch::Evaluation::Proxy::Base::MIN_SCORE
/Users/moonglum/.rvm/gems/ruby-2.1.1/gems/inch-0.3.2/lib/inch/evaluation/proxy/base.rb:8: warning: previous definition of MIN_SCORE was here
/Users/moonglum/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/inch-0.3.2/lib/inch/evaluation/proxy/base.rb:9: warning: already initialized constant Inch::Evaluation::Proxy::Base::MAX_SCORE
/Users/moonglum/.rvm/gems/ruby-2.1.1/gems/inch-0.3.2/lib/inch/evaluation/proxy/base.rb:9: warning: previous definition of MAX_SCORE was here
/Users/moonglum/.rvm/rubies/ruby-2.1.1/lib/ruby/gems/2.1.0/gems/inch-0.3.2/lib/inch/evaluation/proxy/base.rb:11: warning: already initialized constant Inch::Evaluation::Proxy::Base::TAGGED_SCORE
/Users/moonglum/.rvm/gems/ruby-2.1.1/gems/inch-0.3.2/lib/inch/evaluation/proxy/base.rb:11: warning: previous definition of TAGGED_SCORE was here
I'm using the currently released version 0.3.2 of inch.

Inch shouldn't complain about the parameter '_' being undocumented in Ruby

Pretty self-explanatory, but from a recent run of inch show:

# ApplicationController#after_sign_out_path_for
┃ -> /Users/pence/Development/rletters/master/app/controllers/application_controller.rb:43
┃ ------------------------------------------------------------------------------------------------------------
┃ Grade: A - Seems really good
┃ ------------------------------------------------------------------------------------------------------------
┃ + Add a code example (optional)
┃ + Describe the parameter '_'
┃ ------------------------------------------------------------------------------------------------------------

The function at issue:

  # Redirect to the root on successful sign out
  #
  # This method is called by Devise.
  #
  # @return [void]
  def after_sign_out_path_for(_)
    root_url
  end

Underscore is a pretty common placeholder for unused variables, so it's no problem that you're not documenting them. Unfortunately, I can't quickly grok enough of the Inch codebase to submit a PR. Sorry!

BasicObject is shown as undocumented

BasicObject is shown as undocumented for rspec-support

It's also listing BasicObject as undocumented, which by us of course it is, because it belongs to the core library, how do you detect documentation for 3rd party code?
We actually do have docs:

https://github.com/rspec/rspec-expectations/blob/cb13bd12ea335c8bdbf26aada60ef7bbf678a2e8/lib/rspec/expectations/syntax.rb#L105-L132

http://rubydoc.info/github/rspec/rspec-expectations/BasicObject

via rspec/rspec-support#53 (comment)

Do not count TODO, FIXME, etc. comments

I was surprised to find that Inch CI attests my brand new and barely documented gem an excellent doc health. This is because Inch is completely satisfied with TODO comments:

# TODO: document
class Foo
    # TODO: document
    def bar
        puts "undocumented!"
    end
end

Arguably, this should count as completely documented.

I propose that "label" comments such as # TODO should be ignored by inch.

Update Inch to user a newer YARD

yard-0.8.7.5 uses a deprecated method in Rake, and with the release of Rake 12, that method (Rake::TaskManager#last_comment) is gone for good. Is there any particular reason to pin an older version of yard?

Documentation tag @return leads to skip the documentation analysis for a method

I absolutely don't know why but for a simple method with no parameter, when I put the above yard documentation, inch doesn't generate any information about the documentation grade. It seems that the method is not analyzed (even with --pedantic). If I remove the line with @return, it works !

Yard documentation:

Define tags to track, including tags added on command line

@return [String] regexp pattern

Do you have any idea about this curious behavior ?

inch diff fails, when workdir != repo-root

When i inch diff in a subdirectory of a git repository, I get this error:

$ inch diff
fatal: repository '....' does not exist
..../.gem/ruby/2.2.3/gems/inch-0.7.0/lib/inch/utils/shell_helper.rb:5:in `chdir': No such file or directory @ dir_chdir - /var/folders/c0/cyfbk3cj52l9dbgp0_1z1spc0000gn/T/d20151019-81364-1fdhjhl/.... (Errno::ENOENT)
    from ..../.gem/ruby/2.2.3/gems/inch-0.7.0/lib/inch/utils/shell_helper.rb:5:in `git'
    from ..../.gem/ruby/2.2.3/gems/inch-0.7.0/lib/inch/api/diff.rb:64:in `git_reset'
    from ..../.gem/ruby/2.2.3/gems/inch-0.7.0/lib/inch/api/diff.rb:52:in `block in codebase_from_copy'
    from ..../.rubies/ruby-2.2.3/lib/ruby/2.2.0/tmpdir.rb:88:in `mktmpdir'
    from ..../.gem/ruby/2.2.3/gems/inch-0.7.0/lib/inch/api/diff.rb:50:in `codebase_from_copy'
    from ..../.gem/ruby/2.2.3/gems/inch-0.7.0/lib/inch/api/diff.rb:36:in `codebase_for'
    from ..../.gem/ruby/2.2.3/gems/inch-0.7.0/lib/inch/api/diff.rb:21:in `initialize'
    from ..../.gem/ruby/2.2.3/gems/inch-0.7.0/lib/inch/cli/command/diff.rb:26:in `new'
    from ..../.gem/ruby/2.2.3/gems/inch-0.7.0/lib/inch/cli/command/diff.rb:26:in `run'
    from ..../.gem/ruby/2.2.3/gems/inch-0.7.0/lib/inch/cli/command/base.rb:52:in `run'
    from ..../.gem/ruby/2.2.3/gems/inch-0.7.0/lib/inch/cli/command_parser.rb:100:in `run_command'
    from ..../.gem/ruby/2.2.3/gems/inch-0.7.0/lib/inch/cli/command_parser.rb:62:in `run'
    from ..../.gem/ruby/2.2.3/gems/inch-0.7.0/lib/inch/cli/command_parser.rb:52:in `run'
    from ..../.gem/ruby/2.2.3/gems/inch-0.7.0/bin/inch:23:in `<top (required)>'
    from ..../.gem/ruby/2.2.3/bin/inch:23:in `load'
    from ..../.gem/ruby/2.2.3/bin/inch:23:in `<main>'

The ShellHelper is pretty basic, so I'm not really seeing where this comes from, exactly. The cause might even be my own environment, to be honest.

Btw: Nice talk at euruko this weekend! I used your gem today to clean up faulty documentation - with great success.

Incorrect support for RDoc virtual methods

Re: [U] MIME::Type#preferred_extension in mime-types/ruby-mime-types Also probably related to #28 and #40.

I’m not sure if you’ll be able to make this work properly since YARD deliberately does not support a number of RDoc features (including proper use of the :nodoc: directive, because it doesn’t believe gem authors are correct when they say :nodoc:), but most troublesome to me is its inability to support virtual method documentation. Inch reports that MIME::Type#preferred_extension is undocumented, which is technically correct, but with virtual method documentation it is incorrect.

You can see this throughout the mime-types code, but specifically at lib/mime/type.rb:243-265. Here, I have specifically created a virtual method documentation for attr_accessor :preferred_extension and then I have implemented preferred_extension and preferred_extension=. The former I suppressed the documentation on; the latter I :nodoc:ed. YARD ignores everything here, and I suspect it causes inch to do the same.

I do this because I want this documented as an attr_accessor, not as two methods (I realize that YARD doesn’t really distinguish between the two, but RDoc does and I like that).

Thanks for a great tool—I’m enjoying using it despite the problems I’m having getting it to recognize the documentation I have written, and I think it’s improving the documentation I have (which was pretty good to begin with, IMO).

Exclude Frozen Ruby String Declarations

There are a consistent number of files which get a grade of "A" even though all they have is a:

# frozen_string_literal: true

Example here

comment in them. Since this is a very standard thing to have in your Ruby 2.x files, I think it should be explicitly excluded from documentation. Preferably the inch configuration would allow for specification of regexes which match to be excluded.

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.