Giter Club home page Giter Club logo

line-count's Introduction

line-count package

Usage

Press ctrl-alt-shift-L (line-count:open) to open an editor page showing line counts broken down by file, directory, and file type for all files in the project.

File suffixes supported are ..

  • .asm
  • .c
  • .cc
  • .clj
  • .cljs
  • .coffee
  • .cpp
  • .cr
  • .cs
  • .css
  • .cxx
  • .erl
  • .go
  • .groovy
  • .gs
  • .h
  • .handlebars
  • .hbs
  • .hpp
  • .hr
  • .hs
  • .html
  • .htm
  • .hx
  • .hxx
  • .hy
  • .iced
  • .ino
  • .jade
  • .java
  • .jl
  • .js
  • .jsx
  • .less
  • .ld
  • .lua
  • .ls
  • .m
  • .md
  • .ml
  • .mli
  • .mm
  • .mochi
  • .monkey
  • .mustache
  • .nix
  • .nim
  • .nut
  • .php
  • .php5
  • .pl
  • .py
  • .r
  • .rb
  • .rkt
  • .rs
  • .sass
  • .scala
  • .scss
  • .styl
  • .svg
  • .swift
  • .ts
  • .vb
  • .xml
  • .yaml

If you want to add a new type fork this project and do it yourself.

Example Output

Line counts for project c:\apps\line-count\test\exoplanets.
Generated by the Atom editor package Line-Count on July 18 2014 15:26.
Counts are in order of source, comments, and total.

Files
-----
      0     1      3  app/assets/javascripts/admin/application.js.coffee
      3     6     11  app/assets/javascripts/application.js.coffee
      6     0      9  app/assets/javascripts/cards.js.coffee
     18     1     27  app/assets/javascripts/forms.js.coffee
     18     2     33  app/assets/javascripts/pixi_boot.js.coffee
     25     6     46  app/assets/javascripts/planets/boot.js.coffee
     22     0     29  app/assets/javascripts/planets/cloud.js.coffee
     38     2     50  app/assets/javascripts/planets/orbitable.js.coffee
     22     0     33  app/assets/javascripts/planets/planet.js.coffee
      7     0     10  app/assets/javascripts/planets/random.js.coffee
      4     0      9  app/assets/javascripts/planets/utils.js.coffee
     57     9     96  app/assets/javascripts/three_boot.js.coffee
     53     1     59  public/404.html
     53     1     59  public/422.html
     52     1     58  public/500.html
      1     1      3  vendor/assets/javascripts/chosen.jquery.min.js
   8343   387  10358  vendor/assets/javascripts/pixi.dev.js
     60     6    109  vendor/assets/javascripts/postprocessing/BloomPass.js
     32     0     54  vendor/assets/javascripts/postprocessing/DotScreenPass.js
     79     1    145  vendor/assets/javascripts/postprocessing/EffectComposer.js
     33     0     55  vendor/assets/javascripts/postprocessing/FilmPass.js
     45     5     87  vendor/assets/javascripts/postprocessing/MaskPass.js
     30     0     52  vendor/assets/javascripts/postprocessing/RenderPass.js
     32     0     56  vendor/assets/javascripts/postprocessing/SavePass.js
     29     0     52  vendor/assets/javascripts/postprocessing/ShaderPass.js
     24     0     41  vendor/assets/javascripts/postprocessing/TexturePass.js
     18     0     32  vendor/assets/javascripts/shaders/BasicShader.js
     39     0     65  vendor/assets/javascripts/shaders/BleachBypassShader.js
     32     0     52  vendor/assets/javascripts/shaders/BlendShader.js
     86     0    117  vendor/assets/javascripts/shaders/BokehShader.js
    265     0    379  vendor/assets/javascripts/shaders/BokehShader2.js
     37     0     59  vendor/assets/javascripts/shaders/BrightnessContrastShader.js
     29     0     49  vendor/assets/javascripts/shaders/ColorCorrectionShader.js
     29     0     50  vendor/assets/javascripts/shaders/ColorifyShader.js
     57     2    102  vendor/assets/javascripts/shaders/ConvolutionShader.js
     27     0     47  vendor/assets/javascripts/shaders/CopyShader.js
     36     0     59  vendor/assets/javascripts/shaders/DOFMipMapShader.js
     42     0     69  vendor/assets/javascripts/shaders/DotScreenShader.js
     65     3     94  vendor/assets/javascripts/shaders/EdgeShader.js
     48     2     74  vendor/assets/javascripts/shaders/EdgeShader2.js
     68     0    101  vendor/assets/javascripts/shaders/FXAAShader.js
     61    11    105  vendor/assets/javascripts/shaders/FilmShader.js
     59     0     92  vendor/assets/javascripts/shaders/FocusShader.js
     49     0     75  vendor/assets/javascripts/shaders/FresnelShader.js
     42     0     63  vendor/assets/javascripts/shaders/HorizontalBlurShader.js
     44     0     66  vendor/assets/javascripts/shaders/HorizontalTiltShiftShader.js
     46     2     70  vendor/assets/javascripts/shaders/HueSaturationShader.js
     42     0     61  vendor/assets/javascripts/shaders/KaleidoShader.js
     28     0     51  vendor/assets/javascripts/shaders/LuminosityShader.js
     40     0     59  vendor/assets/javascripts/shaders/MirrorShader.js
     33     0     54  vendor/assets/javascripts/shaders/NormalMapShader.js
     38     0     57  vendor/assets/javascripts/shaders/RGBShiftShader.js
    151     9    260  vendor/assets/javascripts/shaders/SSAOShader.js
     33     0     55  vendor/assets/javascripts/shaders/SepiaShader.js
     45     2     79  vendor/assets/javascripts/shaders/TriangleBlurShader.js
     33     1     58  vendor/assets/javascripts/shaders/UnpackDepthRGBAShader.js
     42     0     63  vendor/assets/javascripts/shaders/VerticalBlurShader.js
     44     0     66  vendor/assets/javascripts/shaders/VerticalTiltShiftShader.js
     38     3     64  vendor/assets/javascripts/shaders/VignetteShader.js
  20747  1152  36909  vendor/assets/javascripts/three.js
      1     1      4  vendor/assets/stylesheets/chosen.min.css

Directories
-----------
    220    27    356  app
    220    27    356  app/assets
    220    27    356  app/assets/javascripts
      0     1      3  app/assets/javascripts/admin
    118     8    177  app/assets/javascripts/planets
    158     3    176  public
  31202  1588  50672  vendor
  31202  1588  50672  vendor/assets
  31201  1587  50668  vendor/assets/javascripts
    364    12    651  vendor/assets/javascripts/postprocessing
   1746    35   2747  vendor/assets/javascripts/shaders
      1     1      4  vendor/assets/stylesheets

Types
-----
    220    27    356  coffee
      1     1      4  css
    158     3    176  html
  31201  1587  50668  js

Total
-----
  31580  1618  51204  

Notes

  • Any folder named node_modules is ignored.
  • Please report problems to github issues.

To-DO

  • Add test
  • Filtering

Credit

The engine used by line-count is sloc by Markus Kohlhase. His project can be found here.

License

MIT

line-count's People

Contributors

as3boyan avatar bitoffdev avatar geriatricjacob avatar j-cake avatar liamsi avatar lvcabral avatar mark-hahn avatar mathewmariani avatar onelivesleft avatar ritoon avatar ronmelkhior 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

line-count's Issues

Ignored folders

There should be a way to any user add more ignored folders

Changes required for upcoming CoffeeScript upgrade

Hi! Thanks for maintaining the line-count package!

In Atom v1.12, we are going to upgrade CoffeeScript to the latest version. This upgrade entails one potentially breaking change to the language:

Changed strategy for the generation of internal compiler variable names. Note that this means that @example function parameters are no longer available as naked example variables within the function body.

We think your package may be affected by this upgrade, in the following places:

  • The ex variable here
  • The ex variable here
  • The ex variable here
  • The ex variable here
  • The ex variable here
  • The ex variable here
  • The ex variable here

These findings are based on linting packages with coffeescope. We could be wrong about some of them. When we release v1.12 beta, please test your package against it to make sure that it works. Let me know if you have any further questions; I will be happy to help!

Count .jade files?

Would it be possible to add support for line counting on .jade files as well?

Sum of code and comment counts

Hi, thanks for this package.
It'd be great to have a count of miningful lines which are code and comments IMO.
Maybe the generated text could read:
Counts are in order of code, comments, sum and total (including blank lines).

Handle columns with values wider than 4 chars


Counts are in order of source, comments, and total.

Files
-----
  292   47  399  Gruntfile.coffee
   10    0   15  server.coffee
 5855    0 5855  build/404.html
 5855    0 5855  build/index.html
 5976    0 5976  dev/index.html
    1    5    8  build/css/bootstrap.css
    1    0    1  build/css/main.css
    1    5    6  build/js/bootstrap.js
  355  236  738  build/js/fastclick.js
    1    0    1  build/js/jade.js
    1    0    2  build/js/jquery.history.js
    3    1    5  build/js/jquery.js
    1    8   10  build/js/jquery.viewport.js
    1    0    1  build/js/main.js
  387   14  499  build/js/templates.js
    1    5    8  dev/css/bootstrap.css
 1808  388 2584  dev/css/main.css
 1257  188 1952  dev/js/bootstrap.js
  355  236  738  dev/js/fastclick.js
  122   65  211  dev/js/jade.js
    1    0    2  dev/js/jquery.history.js
 6166 1488 9191  dev/js/jquery.js
    1    8   10  dev/js/jquery.viewport.js
 1609    0 1770  dev/js/main.js
  387   14  499  dev/js/templates.js
    1    5    8  vendor/css/bootstrap.css
 9111 1745 12569  vendor/js/JSXTransformer.js
 1257  188 1952  vendor/js/bootstrap.js
    1    5    6  vendor/js/bootstrap.min.js
  355  236  738  vendor/js/fastclick.js
  122   65  211  vendor/js/jade.js
 6166 1488 9191  vendor/js/jquery-2.1.1.js
    3    1    5  vendor/js/jquery-2.1.1.min.js
    1    0    2  vendor/js/jquery.history.js
    1    0    2  vendor/js/jquery.swipe.js
    1    8   10  vendor/js/jquery.viewport.js
 9646 7219 18884  vendor/js/react-with-addons.js
    4   17   21  vendor/js/react-with-addons.min.js
 8771 6647 17228  vendor/js/react.js
    4   17   21  vendor/js/react.min.js
    1    0    2  app/assets/javascripts/core.coffee
   32    0   42  app/assets/javascripts/helpers.coffee
  184    0  243  app/assets/javascripts/main.coffee
  106    0  134  app/assets/javascripts/promises.coffee
   54    0   72  app/assets/javascripts/router.coffee
  118    1  152  custom_modules/data-parser/tasks/data-parser.coffee
   44    0   63  custom_modules/data-parser/tasks/image-exporter.coffee
   37    0   47  app/assets/javascripts/grid/cell.coffee
   47    0   66  app/assets/javascripts/grid/grid.coffee
   35    0   49  app/assets/javascripts/grid/scrolling.coffee
  176  137  377  app/assets/javascripts/mixins/core.coffee
   42    2   57  app/assets/javascripts/transitions/core.coffee
    4    0    5  app/assets/javascripts/widgets/back_to_top.coffee
   94   62  202  app/assets/javascripts/widgets/core.coffee
   10    0   13  app/assets/javascripts/widgets/drawer.coffee
   16    0   20  app/assets/javascripts/widgets/enlarge.coffee
   13    2   20  app/assets/javascripts/widgets/image_loading.coffee
    5    0    6  app/assets/javascripts/widgets/navigation_links.coffee
    1    0    2  app/assets/javascripts/widgets/popover.coffee
   35    0   51  app/assets/javascripts/widgets/price_filter.coffee
   20    0   29  app/assets/javascripts/widgets/video_player.coffee

Types
-----
 1376  251 2066  coffee
 17686    0 17686  html
 1812  403 2609  css
 46091 19899 76475  js

Total
-----
 66965 20553 98836

As you can see when a column contains a value with more than 4 chars the layout is somewhat messed-up. The column size should be the measured using the max length of the column values.

Add support for EJS files (.ejs)

Many people including myself use EJS as the view engine for Express. It's very, very similar to HTML and shouldn't take much work to add. It would be awesome to see support for EJS files. The file-extension is .ejs and website is http://ejs.co/.

Running the command creates a file in project root

After running the command there's a file in my project's root named 'Line Count', which is fine, but when I close the tab opened by line-count, this file stays there. I would expect this to be a temporary file. I suspect this has something to do with the autosave package saving the tab upon opening it, because disabling autosave fixes this.

I'm on Linux Debian, Atom 0.187.0

Fix README's .html list item

Fix the .html list item in the README by removing the last -.

...
- .less
- .py
- .html
-
If you want to...

Becomes

...
- .less
- .py
- .html

If you want to...

Bower Components

Hey,
just tested this nice project.
When I run it in my Programm also the bower_components folder gets counted.
Mayby this Folder should also be ignored like node_modules

Greetz

Uncaught TypeError: Cannot read property 'getPath' of undefined

Prerequisites

Description

Steps to Reproduce

Expected behavior:

Actual behavior:

Versions

Atom: 1.60.0 x64
Electron: 9.4.4
OS: Microsoft Windows 10 Pro
Thrown From: line-count package 0.5.2

Stack Trace

Uncaught TypeError: Cannot read property 'getPath' of undefined

At C:\Users\admin\.atom\packages\line-count\lib\line-count.coffee:124

TypeError: Cannot read property 'getPath' of undefined
    at Object.open (/packages/line-count/lib/line-count.coffee:124:51)
    at /packages/line-count/lib/line-count.coffee:97:71)
    at CommandRegistry.handleCommandEvent (~/AppData/Local/atom/app-1.60.0/resources/app/static/<embedded>:11:352694)
    at CommandRegistry.dispatch (~/AppData/Local/atom/app-1.60.0/resources/app/static/<embedded>:11:351169)
    at AtomEnvironment.dispatchContextMenuCommand (~/AppData/Local/atom/app-1.60.0/resources/app/static/<embedded>:1:833477)
    at EventEmitter.t (~/AppData/Local/atom/app-1.60.0/resources/app/static/<embedded>:1:841531)
    at EventEmitter.emit (events.js:223:5)
    at Object.onMessage (electron/js2c/renderer_init.js:115:818)

Commands

 23x -6:40.5.0 core:backspace (input.hidden-input)
  3x -5:21.7.0 core:paste (input.hidden-input)
     -4:08.5.0 core:backspace (input.hidden-input)
     -3:00.0 core:paste (input.hidden-input)
     -2:59.2.0 core:backspace (input.hidden-input)
     -1:44.3.0 core:paste (div.line)
     -0:04.2.0 line-count:open (div.item-views)

Non-Core Packages

aligner-golang 0.1.0 
atom-ide-golang 0.1.6 
atom-material-syntax 1.0.8 
atom-material-ui 2.1.3 
atom-rubinius-terminal 0.0.3 
git-plus 8.7.1 
go-plus 6.1.0 
ide-golang 0.0.5 
line-count 0.5.2 
line-count-status 0.0.3 

Additional Information

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.