Skip to content
New issue

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

Added Danger, PR linter. #31

Merged
merged 1 commit into from
Dec 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ AllCops:
Exclude:
- vendor/**/*

Metrics/BlockLength:
Enabled: true
Exclude:
- spec/**/*
Naming/MethodName:
Enabled: false

Style/Documentation:
Enabled: false

Metrics:
Enabled: false

Metrics/LineLength:
Max: 256

inherit_from: .rubocop_todo.yml
39 changes: 2 additions & 37 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2018-12-15 12:38:08 -0500 using RuboCop version 0.61.1.
# on 2018-12-16 09:30:57 -0500 using RuboCop version 0.61.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -13,46 +13,17 @@ Gemspec/RequiredRubyVersion:
Exclude:
- 'fui.gemspec'

# Offense count: 1
Lint/IneffectiveAccessModifier:
Exclude:
- 'lib/fui/finder.rb'

# Offense count: 1
# Configuration parameters: IgnoreImplicitReferences.
Lint/ShadowedArgument:
Exclude:
- 'bin/fui'

# Offense count: 2
# Offense count: 1
Lint/UselessAssignment:
Exclude:
- 'lib/fui/finder.rb'
- 'spec/fui/fui_spec.rb'

# Offense count: 2
Metrics/AbcSize:
Max: 17

# Offense count: 7
# Configuration parameters: CountComments, ExcludedMethods.
# ExcludedMethods: refine
Metrics/BlockLength:
Max: 144

# Offense count: 2
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/MethodLength:
Max: 15

# Offense count: 2
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'lib/fui/finder.rb'
- 'lib/fui/header.rb'

# Offense count: 6
# Configuration parameters: AllowedVariables.
Style/GlobalVars:
Expand All @@ -77,9 +48,3 @@ Style/NumericPredicate:
Exclude:
- 'spec/**/*'
- 'lib/fui/finder.rb'

# Offense count: 34
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 203
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
rvm:
- 2.5.3

before_script:
- bundle exec danger
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
### 0.5.0 (Next)

* Your contribution here.
* [#29](https://github.com/dblock/fui/pull/29): Added support for ignoring paths through `-i`, `--ignore-path` - [@jeffctown](https://github.com/jeffctown).
* [#28](https://github.com/dblock/fui/pull/28): Added support for finding global imports (bracket notation) - [@jeffctown](https://github.com/jeffctown).
* [#28](https://github.com/dblock/fui/pull/28): Added ability to turn off global or local import checks through `-g`, `--ignore-global-imports` or `-l`, `--ignore-local-imports` - [@jeffctown](https://github.com/jeffctown).
* [#28](https://github.com/dblock/fui/pull/28): The `--ignorexib` option has been renamed to `--ignore-xib-files` - [@jeffctown](https://github.com/jeffctown).

* [#31](https://github.com/dblock/fui/pull/31): Added Danger, PR linter and a README TOC - [@jeffctown](https://github.com/jeffctown).
* Your contribution here.

### 0.4.1 (8/16/2017)

* [#24](https://github.com/dblock/fui/pull/24): Support .mm files - [@shachlan](https://github.com/Shachlan).
Expand Down
2 changes: 2 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
toc.check
changelog.check
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ source 'http://rubygems.org'

gemspec

gem 'danger-changelog', '~> 0.3.0'
gem 'danger-toc', '~> 0.1'
gem 'rake'
gem 'rspec', '~> 3.4.0'
gem 'rubocop', '0.61.1'
44 changes: 30 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,79 +6,95 @@ Fui

Find unused Objective-C imports.

# Table of Contents

- [Usage](#usage)
- [Get Help](#get-help)
- [Find Unused Classes in the Current Directory](#find-unused-classes-in-the-current-directory)
- [Find Unused Classes in any Path](#find-unused-classes-in-any-path)
- [Skip Interface Builder (.xib) Files](#skip-interface-builder-xib-files)
- [Ignore Local Imports](#ignore-local-imports)
- [Ignore Global Imports](#ignore-global-imports)
- [Ignore a Path](#ignore-a-path)
- [Ignore Multiple Paths](#ignore-multiple-paths)
- [Delete All Unused Class Files with Prompt](#delete-all-unused-class-files-with-prompt)
- [Xcode Plugin](#xcode-plugin)
- [Contributing](#contributing)
- [Copyright and License](#copyright-and-license)

## Usage

```
gem install fui
```

#### Get Help
### Get Help

```
fui help
```

#### Find Unused Classes in the Current Directory
### Find Unused Classes in the Current Directory

```
fui find
```

The `find` command lists all the files that contain unused imports and exits with the number of files found.

#### Find Unused Classes in a Path
### Find Unused Classes in any Path

```
fui --path=~/source/project/Name find
```

#### Find Unused Classes in a Path Skipping Interface Builder (.xib) Files
### Skip Interface Builder (.xib) Files

Running `fui` with `-x` (or `--ignore-xib-files`) will, for example, mark `Foo.h` as unused when `Foo.xib` holds a reference to the `Foo` class and no other references to Foo.h exist.

```
fui -x --path=~/source/project/Name find
```

#### Find Unused Classes in a Path Ignoring Local (quotation syntax) Imports
### Ignore Local Imports

Running `fui` with `-l` (or `--ignore-local-imports`) will, for example, mark `Foo.h` as unused when `Bar.h` contains a local import of `Foo.h` (`#import Foo.h`)
Running `fui` with `-l` (or `--ignore-local-imports`) will, for example, mark `Foo.h` as unused when `Bar.h` contains a local (quotation syntax) import of `Foo.h` (eg. `#import Foo.h`).

```
fui -l --path=~/source/project/Name find
```

#### Find Unused Classes in a Path Ignoring Global (bracket syntax) Imports
### Ignore Global Imports

Running `fui` with `-g` (or `--ignore-global-imports`) will, for example, mark `Foo.h` as unused when `Bar.h` contains a global import of `Foo.h` (`#import <Framework/Foo.h>`)
Running `fui` with `-g` (or `--ignore-global-imports`) will, for example, mark `Foo.h` as unused when `Bar.h` contains a global (bracket syntax) import of `Foo.h` (eg. `#import <Framework/Foo.h>`).

```
fui -g --path=~/source/project/Name find
```

#### Find Unused Classes in a Path And Also Ignoring a Path
### Ignore a Path

Running `fui` with `-i` (or `--ignore-path`) will, for example, ignore a `Pods` folder when searching for headers or referencing files
Running `fui` with `-i` (or `--ignore-path`) will, for example, ignore a `Pods` folder when searching for headers or referencing files.

```
fui --path=~/source/project/Name --ignore-path=Pods find
```

#### Find Unused Classes in a Path And Also Ignoring Multiple Paths
### Ignore Multiple Paths

Running `fui` with `-i` (or `--ignore-path`) can ignore multiple folders when searching for headers or referencing files
Running `fui` with `-i` (or `--ignore-path`) can ignore multiple folders when searching for headers or referencing files.

```
fui --path=~/source/project/Name --ignore-path=Pods --ignore-path=Libraries find
```

#### Delete All Unused Class Files w/ Prompt
### Delete All Unused Class Files with Prompt

```
fui --path=~/source/project/Name delete --perform --prompt
```

#### Xcode Plugin
## Xcode Plugin

Use [xcfui](https://github.com/jcavar/xcfui) for integration with Xcode.

Expand Down