Skip to content

Commit f8bd35f

Browse files
feat: dracula v0.1 rust src
1 parent bb90499 commit f8bd35f

File tree

9 files changed

+592
-2
lines changed

9 files changed

+592
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
.DS_Store

Cargo.lock

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[package]
2+
name = "dracula"
3+
description = "🧛 Count-ing lines, AH AH AHH!"
4+
version = "0.1.0"
5+
author = "Swarnim Arun <[email protected]>"
6+
edition = "2021"
7+
license-file = "LICENSE"
8+
documentation = "https://docs.rs/dracula"
9+
homepage = "https://github.com/deepsourcelabs/dracula"
10+
repository = "https://github.com/deepsourcelabs/dracula"
11+
keywords = ["parsing", "line-count"]
12+
categories = ["command-line-utilities", "text-processing"]
13+
14+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
15+
16+
[dependencies.log]
17+
version = "0.4"
18+
optional = true
19+
20+
[features]
21+
log = ["dep:log"]
22+
cli = ["log"]

README.md

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,56 @@
1-
# line-munch
2-
Library to calculate lines of code for a given project. Works for all languages.
1+
# "Count" Dracula
2+
3+
A parser + utils for counting lines and figuring out their meaningfulness for better line counting API.
4+
5+
Can identify lines based on the following criteria:
6+
- Blank, (contains only whitespace)
7+
- Meaningless (has no impact on the code, e.g. braces, comments, etc.)
8+
- Comment (number of lines with comments)
9+
- String (strings, language strings, raw strings, literal strings, format strings, etc.)
10+
- Source (the actual code)
11+
12+
## How to run?
13+
14+
Tentative, planned to be made into a library + binary.
15+
16+
The APIs for use as libraries are WIP.
17+
18+
```sh
19+
# to test
20+
cargo test
21+
22+
# to run as a dumb util
23+
cargo run -- <rust|python|cpp|c> /path/to/file
24+
```
25+
26+
## Table of Contents
27+
- ["Count" Dracula](#count-dracula)
28+
- [How to run?](#how-to-run)
29+
- [Table of Contents](#table-of-contents)
30+
- [Key Goals](#key-goals)
31+
- [Works with](#works-with)
32+
- [Dependencies](#dependencies)
33+
- [Development](#development)
34+
- [Credits](#credits)
35+
36+
## Key Goals
37+
38+
- General enough to work over any language.
39+
- Performant enough to work with as many files as possible, and allow scanning huge files.
40+
- Pull Parsing for lazy parsing of the code to allow flexible usage.
41+
42+
## Works with
43+
44+
- C & C++
45+
- Python
46+
- Rust
47+
- etc...
48+
49+
## Dependencies
50+
51+
Default runtime dependencies: None.
52+
53+
Rust version dependencies:`1.59.0` (Could possibly work with older Rust versions)
54+
55+
## Development
56+
## Credits

src/bin.rs

Whitespace-only changes.

src/count.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// TODO: WIP on a API for count dracula
2+

src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
pub(crate) mod parse;
2+
3+
// TODO: WIP on a API for count dracula
4+
pub mod count;
5+
6+
7+
// ALl our tests live here.
8+
#[cfg(test)]
9+
mod tests;

0 commit comments

Comments
 (0)