Coder Social home page Coder Social logo

python-count-lines-of-code's Introduction

Count Lines of Code

Small python script that counts lines of code in a project.

This was written in Python 2.7 and was tested in Linux.

Running

You can call it by running

cloc.py /path/of/your/project /path/to/excludelist.csv

It has an array with the extensions that will be excluded, if you have certain extensions that you need excluded from the count, add them to the array

exclude = ['sample','exclude','description','png','jpg','config','HEAD','packed-refs','idx','master','pack','txt','index','gitignore']

If you are including a csv file, the contents should look like this. Without spaces in between the file types

git,docx,xslsx,csv

Info

  • Python version: 2.7
  • Operating System: Linux
  • Accepts arguments from a command line
  • If no arguments are found from the command line, ask the user for an input inside of the application.
  • There is a version for Python 3.4+ in a separate branch called python3
  • Has been tested and works in Windows 10. There is a bug where it picks up random file types by searching through what is probably the .git folder.
  • Include a csv to define excluded file types

To Do

  • If a .gitignore file is found, ask the user if they would like to use that to append to their current ignore list

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.