We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exclude_paths
I love danger & its plugin gems. They are always a part of my CI suite. I would like to express my gratitude to the maintainers of this project. 👏👏👏
danger
def lint files_to_lint = fetch_files_to_lint code_smells = run_linter(files_to_lint) warn_each_line(code_smells) end
fetch_files_to_lint = git.modified_files + git.added_files
examiner
run_linter(files_to_lint) def run_linter(files_to_lint) configuration = ::Reek::Configuration::AppConfiguration.from_path(nil) files_to_lint.flat_map do |file| examiner = ::Reek::Examiner.new(file, configuration: configuration) examiner.smells end end
examiner = ::Reek::Examiner.new(file, configuration: configuration)
This examiner does not check if the file path is in exclude_paths on Reek configuration. And as such, posts warning messages on PR.
exclude_paths is .reek.yml has no effect.
.reek.yml
exclude_paths: - db/migrate
It gets particularly annoying if you add migration files. It posts FeatureEnvy message on each files.
FeatureEnvy
Refers to 't' more than self
I made it work with the following change:
module MyDanger module ReekDecorator private def fetch_files_to_lint files = git.modified_files + git.added_files excluded_files = files.to_a.select { |file| file_excluded?(file) } files_to_lint = files - excluded_files ::Reek::Source::SourceLocator.new(files_to_lint).sources end def file_excluded?(filename) configuration = ::Reek::Configuration::AppConfiguration.from_path(nil) configuration.send(:excluded_paths).map(&:expand_path).map do |excluded_path| Pathname(filename).expand_path.fnmatch?(File.join(excluded_path, '**')) end.any? end end end Danger::DangerReek.prepend(MyDanger::ReekDecorator)
fetch_files_to_lint
excluded_paths
It would be great to have some community feedback on this.
I can create a PR if my proposed solution is agreeable.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Acknowledgement
I love
danger
& its plugin gems. They are always a part of my CI suite. I would like to express my gratitude to the maintainers of this project. 👏👏👏Current Behavior
Danger::DangerReek
Step Analysis
examiner
object for each files & evaluates it's smells.examiner = ::Reek::Examiner.new(file, configuration: configuration)
This examiner does not check if the file path is in
exclude_paths
on Reek configuration. And as such, posts warning messages on PR.Issue
exclude_paths
is.reek.yml
has no effect.It gets particularly annoying if you add migration files. It posts
FeatureEnvy
message on each files.Proposed Enhancement
I made it work with the following change:
fetch_files_to_lint
method to discard files inexcluded_paths
pathIt would be great to have some community feedback on this.
I can create a PR if my proposed solution is agreeable.
The text was updated successfully, but these errors were encountered: