From 2a07670d81b5f282ef87cfbbf73d3a51b34c2f0d Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Sun, 1 Sep 2013 17:00:13 +0200 Subject: [PATCH] Release 0.0.5 This release contains numerous enhancements and bug fixes but the two biggest noteworthy additions are support for parsing basic YARD tags and loading externally defined constants/files. See doc/changelog.md for more information. --- checksum/ruby-lint-0.0.5.gem.sha512 | 1 + doc/changelog.md | 94 +++++++++++++++++++++++++++++ lib/ruby-lint/version.rb | 2 +- 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 checksum/ruby-lint-0.0.5.gem.sha512 diff --git a/checksum/ruby-lint-0.0.5.gem.sha512 b/checksum/ruby-lint-0.0.5.gem.sha512 new file mode 100644 index 0000000..a479eee --- /dev/null +++ b/checksum/ruby-lint-0.0.5.gem.sha512 @@ -0,0 +1 @@ +dcc8326dec9cc6bdfdcf19e73a1f69172ffcdf4105be974ab644af00a44cd08306569d1001fe5a680e1ed5158bd2b73be6af801df096a037e7e06fcc116dd086 \ No newline at end of file diff --git a/doc/changelog.md b/doc/changelog.md index 6cac92f..781ff32 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -5,6 +5,98 @@ This document contains a short summary of the various releases of ruby-lint. For a full list of commits included in each release see the corresponding Git tags (named after the versions). +## 0.0.5 - 2013-09-01 + +Originally slated for August 1st I decided to push this release back one month +to buy myself some extra time to polish features, resolve more bugs and +procrastinate more. Besides numerous bug fixes and extra polish this release +contains two big new features that I'd like to highlight: + +* support for parsing basic YARD tags +* loading of externally defined constants/files from the local file system + +### YARD Support + +[YARD][yard] provides a set of tags that can aid in documenting your code. For +example, `@param` is a tag used to document the type, name and description of a +method parameter. Since Ruby has no form of type hinting you're often left to +wonder what kind of objects a method can work with. + +In version 0.0.5 support for two tags was added: + +* `@param` +* `@return` + +When ruby-lint finds methods documented using these tags it will use them to +pull in information about the parameter types and return values. This greatly +increases the accuracy of ruby-lint, given your code is documented. Consider +the following example: + + def multiply(value, multiplier) + return value * value + end + +If ruby-lint were to process the above code it would have no idea what kind of +object `value` and `multiplier` are and thus wouldn't be able to much with the +above code. When documenting the above method with the mentioned YARD tags +ruby-lint *is* capable of doing this: + + ## + # @param [Fixnum] value + # @param [Fixnum] multiplier + # @return [Fixnum] + # + def multiply(value, multiplier) + return value * value + end + +By parsing the YARD tags ruby-lint can now know what the parameter types are +and what type of data the method returns. This in turn allows ruby-lint to +perform full analysis on the arguments instead of being forced to ignore them +completely. + +### Loading External Files + +In previous versions ruby-lint had no way of loading external code that was not +pre-defined using the built-in definitions (found in +`lib/ruby-lint/definitions`). As a result a lot of false positives would be +triggered when analysing complex projects (e.g. the typical Rails project). + +This has been addressed by introducing so called "file scanners" and "file +loaders". In short, these scan for a set of constants used in a file and try to +find the corresponding Ruby file that defines it (recursively). This greatly +enhances the accuracy of analysis. + +Currently the algorithm for this is rather basic and can, especially in big +projects, slow analysis down by quite a bit. This will be resolved in upcoming +releases. Keep an eye on the following issues for more information: + +* +* + +### Other Changes + +Besides the two features mentioned above various other changes have also been +made, these are listed below. + +* Lots of bug fixes and cleanups, as you'd expect. +* Constants (classes and modules) can now be referred by their name inside + themselves (e.g. "Foo" inside the class "Foo" refers to that class). +* The text presenter now only shows filenames instead of the full file path, + reducing clutter. +* Support for default global variables such as `$LOADED_FEATURES` +* Support for methods such as `alias` and `alias_method` +* Support for the `attr_*` family of methods +* The test suite has been migrated from Bacon to RSpec +* Support for keyword arguments. +* Updated built-in Rails definitions to include more methods. +* Debugging/benchmarking output for the analyze command. +* The analysis class ConfusingVariables has been removed due to not being very + useful. +* Various issues with method lookups inside blocks have been resolved. +* Various internals have been cleaned up. +* Improved error messages for calls to undefined methods. + ## 0.0.4 - 2013-07-14 Near total refactor of the entire project. New parser setup based on the @@ -27,3 +119,5 @@ Various changes to the old parser. ## 0.0.1 - 2012-11-13 First public release of ruby-lint. + +[yard]: http://yardoc.org/ diff --git a/lib/ruby-lint/version.rb b/lib/ruby-lint/version.rb index 9dbcc7a..95ba65c 100644 --- a/lib/ruby-lint/version.rb +++ b/lib/ruby-lint/version.rb @@ -1,3 +1,3 @@ module RubyLint - VERSION = '0.0.4' + VERSION = '0.0.5' end # RubyLint