Skip to content

Commit a589291

Browse files
committed
Added Danger, PR linter.
1 parent 9c99ed7 commit a589291

7 files changed

+53
-57
lines changed

.rubocop.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@ AllCops:
22
Exclude:
33
- vendor/**/*
44

5-
Metrics/BlockLength:
6-
Enabled: true
7-
Exclude:
8-
- spec/**/*
5+
Naming/MethodName:
6+
Enabled: false
7+
8+
Style/Documentation:
9+
Enabled: false
10+
11+
Metrics:
12+
Enabled: false
13+
14+
Metrics/LineLength:
15+
Max: 256
916

1017
inherit_from: .rubocop_todo.yml

.rubocop_todo.yml

+2-37
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2018-12-15 12:38:08 -0500 using RuboCop version 0.61.1.
3+
# on 2018-12-16 09:30:57 -0500 using RuboCop version 0.61.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -13,46 +13,17 @@ Gemspec/RequiredRubyVersion:
1313
Exclude:
1414
- 'fui.gemspec'
1515

16-
# Offense count: 1
17-
Lint/IneffectiveAccessModifier:
18-
Exclude:
19-
- 'lib/fui/finder.rb'
20-
2116
# Offense count: 1
2217
# Configuration parameters: IgnoreImplicitReferences.
2318
Lint/ShadowedArgument:
2419
Exclude:
2520
- 'bin/fui'
2621

27-
# Offense count: 2
22+
# Offense count: 1
2823
Lint/UselessAssignment:
2924
Exclude:
30-
- 'lib/fui/finder.rb'
3125
- 'spec/fui/fui_spec.rb'
3226

33-
# Offense count: 2
34-
Metrics/AbcSize:
35-
Max: 17
36-
37-
# Offense count: 7
38-
# Configuration parameters: CountComments, ExcludedMethods.
39-
# ExcludedMethods: refine
40-
Metrics/BlockLength:
41-
Max: 144
42-
43-
# Offense count: 2
44-
# Configuration parameters: CountComments, ExcludedMethods.
45-
Metrics/MethodLength:
46-
Max: 15
47-
48-
# Offense count: 2
49-
Style/Documentation:
50-
Exclude:
51-
- 'spec/**/*'
52-
- 'test/**/*'
53-
- 'lib/fui/finder.rb'
54-
- 'lib/fui/header.rb'
55-
5627
# Offense count: 6
5728
# Configuration parameters: AllowedVariables.
5829
Style/GlobalVars:
@@ -77,9 +48,3 @@ Style/NumericPredicate:
7748
Exclude:
7849
- 'spec/**/*'
7950
- 'lib/fui/finder.rb'
80-
81-
# Offense count: 34
82-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
83-
# URISchemes: http, https
84-
Metrics/LineLength:
85-
Max: 203

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
rvm:
22
- 2.5.3
3+
4+
before_script:
5+
- bundle exec danger

CHANGELOG.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
### 0.5.0 (Next)
22

3-
* Your contribution here.
43
* [#29](https://github.com/dblock/fui/pull/29): Added support for ignoring paths through `-i`, `--ignore-path` - [@jeffctown](https://github.com/jeffctown).
54
* [#28](https://github.com/dblock/fui/pull/28): Added support for finding global imports (bracket notation) - [@jeffctown](https://github.com/jeffctown).
65
* [#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).
76
* [#28](https://github.com/dblock/fui/pull/28): The `--ignorexib` option has been renamed to `--ignore-xib-files` - [@jeffctown](https://github.com/jeffctown).
8-
7+
* [#31](https://github.com/dblock/fui/pull/31): Added Danger, PR linter and a README TOC - [@jeffctown](https://github.com/jeffctown).
8+
* Your contribution here.
9+
910
### 0.4.1 (8/16/2017)
1011

1112
* [#24](https://github.com/dblock/fui/pull/24): Support .mm files - [@shachlan](https://github.com/Shachlan).

Dangerfile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
toc.check
2+
changelog.check

Gemfile

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ source 'http://rubygems.org'
22

33
gemspec
44

5+
gem 'danger-changelog', '~> 0.3.0'
6+
gem 'danger-toc', '~> 0.1'
57
gem 'rake'
68
gem 'rspec', '~> 3.4.0'
79
gem 'rubocop', '0.61.1'

README.md

+30-14
Original file line numberDiff line numberDiff line change
@@ -6,79 +6,95 @@ Fui
66

77
Find unused Objective-C imports.
88

9+
# Table of Contents
10+
11+
- [Usage](#usage)
12+
- [Get Help](#get-help)
13+
- [Find Unused Classes in the Current Directory](#find-unused-classes-in-the-current-directory)
14+
- [Find Unused Classes in any Path](#find-unused-classes-in-any-path)
15+
- [Skip Interface Builder (.xib) Files](#skip-interface-builder-xib-files)
16+
- [Ignore Local Imports](#ignore-local-imports)
17+
- [Ignore Global Imports](#ignore-global-imports)
18+
- [Ignore a Path](#ignore-a-path)
19+
- [Ignore Multiple Paths](#ignore-multiple-paths)
20+
- [Delete All Unused Class Files with Prompt](#delete-all-unused-class-files-with-prompt)
21+
- [Xcode Plugin](#xcode-plugin)
22+
- [Contributing](#contributing)
23+
- [Copyright and License](#copyright-and-license)
24+
925
## Usage
1026

1127
```
1228
gem install fui
1329
```
1430

15-
#### Get Help
31+
### Get Help
1632

1733
```
1834
fui help
1935
```
2036

21-
#### Find Unused Classes in the Current Directory
37+
### Find Unused Classes in the Current Directory
2238

2339
```
2440
fui find
2541
```
2642

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

29-
#### Find Unused Classes in a Path
45+
### Find Unused Classes in any Path
3046

3147
```
3248
fui --path=~/source/project/Name find
3349
```
3450

35-
#### Find Unused Classes in a Path Skipping Interface Builder (.xib) Files
51+
### Skip Interface Builder (.xib) Files
3652

3753
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.
3854

3955
```
4056
fui -x --path=~/source/project/Name find
4157
```
4258

43-
#### Find Unused Classes in a Path Ignoring Local (quotation syntax) Imports
59+
### Ignore Local Imports
4460

45-
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`)
61+
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`).
4662

4763
```
4864
fui -l --path=~/source/project/Name find
4965
```
5066

51-
#### Find Unused Classes in a Path Ignoring Global (bracket syntax) Imports
67+
### Ignore Global Imports
5268

53-
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>`)
69+
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>`).
5470

5571
```
5672
fui -g --path=~/source/project/Name find
5773
```
5874

59-
#### Find Unused Classes in a Path And Also Ignoring a Path
75+
### Ignore a Path
6076

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

6379
```
6480
fui --path=~/source/project/Name --ignore-path=Pods find
6581
```
6682

67-
#### Find Unused Classes in a Path And Also Ignoring Multiple Paths
83+
### Ignore Multiple Paths
6884

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

7187
```
7288
fui --path=~/source/project/Name --ignore-path=Pods --ignore-path=Libraries find
7389
```
7490

75-
#### Delete All Unused Class Files w/ Prompt
91+
### Delete All Unused Class Files with Prompt
7692

7793
```
7894
fui --path=~/source/project/Name delete --perform --prompt
7995
```
8096

81-
#### Xcode Plugin
97+
## Xcode Plugin
8298

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

0 commit comments

Comments
 (0)