Git Product home page Git Product logo

fui's Introduction

Fui

Gem Version Build Status

Find unused Objective-C imports.

Table of Contents

Usage

gem install fui

Get Help

fui help

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 any Path

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

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

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 (quotation syntax) import of Foo.h (eg. #import Foo.h).

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

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 (bracket syntax) import of Foo.h (eg. #import <Framework/Foo.h>).

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

Ignore a Path

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

Ignore Multiple Paths

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 with Prompt

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

Xcode Plugin

Use xcfui for integration with Xcode.

Contributing

There're a few feature requests and known issues. Please contribute! See CONTRIBUTING.

Copyright and License

Copyright (c) 2014-2018, Daniel Doubrovkine, Artsy, based on code by Dustin Barker.

This project is licensed under the MIT License.

fui's People

Contributors

dblock avatar ezor avatar jeffctown avatar paulyoung avatar readmecritic avatar shachlan avatar zeveisenberg 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  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

fui's Issues

Should scan also Pre-Compiled Headers, too

I got result that a file, which was imported ONLY in project's .pch file, was an unused import. This is a false positive, app wouldn't compile without it.

My project contains a mixture of Objective-C and C++ code, wonder if you scan also .mm files. I took a look at some fui file, found this " k.path.gsub(/.h$/, '.m' ", which looks a bit suspicious.

fui name is misleading

I was looking for a tool that can help me to remove unused #import at top of a class.

This utility is nice, but it does not "find unused import", but find unused class (as stated in the readme).

Is it possible/expected to have the fui command tell :

SomeClass.m:14 unused import of SomeOtherClass.h

?

Add Swift support

You can use the image scanning and useless resources related to the swift, useless code scanning?

fui Syntax Error

I'm getting this error when I try to use fui:

/usr/bin/fui:19:in `load': /Library/Ruby/Gems/1.8/gems/fui-0.2.0/bin/fui:9: syntax error, unexpected ':', expecting $end (SyntaxError)
flag [:p, :path], desc: 'Path to search', default_value: Dir.pwd
                       ^
    from /usr/bin/fui:19

Support forward declarations

For example, some of these forward declarations are no longer unused:

#import <Foundation/Foundation.h>

@class Foo;
@class Bar;
@protocol Bar;

@interface Qux

@property (nonatomic, strong) Baz *baz;

@end

On Macbook, getting a syntax error

I know almost nothing about Ruby. When I run fui I see the following
/usr/bin/fui:19:in `load': /Library/Ruby/Gems/1.8/gems/fui-0.2.0/bin/fui:9: syntax error, unexpected ':', expecting $end (SyntaxError)
flag [:p, :path], desc: 'Path to search', default_value: Dir.pwd

My macbook have ruby 1.8.7. Help appreciated.

Delete .xib files

There're .xib files associated with an unused view that should be deleted.

Cannot work

When use fui find in project directory in terminal , no content appear in console . How can I know the command is executing ? And does it working ?

Getting no results

Hey, I ran this against an objective-c code base, but no matter how many unused imports I add, I don't get any results. I turned on verbose, and it is scanning the files that have unused imports. This is an xcode 5.1.1 (ios7) project. Thoughts?

It doesn't work

execute fui find command. its list all files in the current folder, not the unused class file

Update .xcproj files

We could go as far as edit the xcproj file and remove the files being deleted.

doesn't include class extensions when determining if something is unused

when i try to find all unused classes, it tells me that one of them is not used when it clearly is. could it be that it's because the import for it is in a class extension, and so fui doesn't believe it's being imported at all? i typically have MyClass.h and MyClass_Private.h, and this private header which is a class extension is where it's imported

Can't work when system ruby version is not 2.3

Hi there,
After I type 'fui' in terminal, I get an error:
-bash: /usr/local/bin/fui: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory

It seems that this tool has dependency of ruby 2.3, but my system ruby version is not 2.3.

Anyone please help me? Thanks.

swift

Does it support swift 2.3 / swift 3 ?
It would be really nice.

Support #import without spaces

I noticed that if you have a file that is imported and accidentally missing a space

 #import"filename.h"

it is not counted and therefore the file can be marked as unused even if it is. The #import search should ideally be a regex that supports any amount of spaces.

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.