Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This is a GitHub CODEOWNERS file
# These owners will be the default owners for everything in the repository
# and will be requested for review when someone opens a pull request.

* @dmkjfs # <dmkjfs@gmail.com>
4 changes: 4 additions & 0 deletions .github/CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This is a GitHub CONTRIBUTORS file
# These are contributors who previously commited to this repository

* @dmkjfs # <dmkjfs@gmail.com>
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: "BUG: <place your title here>"
labels: bug
assignees: ''

---

### ✏️ Short description
A clear and short description of what the bug is

### 🌍 Environment
- OS:
- App version:
- Other conditions \[optional]:

### 📜 Steps to reproduce
1. step one
2. step two
3. step three

### 👀 Expected behavior
A clear and concise description of what you expected to happen

### 👀 Real behavior
A clear and concise description of what happened

### 🖼️ Screenshots or code snippets
If applicable, add screenshots or code snippets to help explain your problem.

### 📝 Additional context \[optional]
Add any other context about the problem here
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "FEATURE REQUEST: <your title here>"
labels: suggestion
assignees: ''

---

### 👀 Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when \[...]

### ❤️ Describe the solution you'd like
A clear and concise description of what you want to happen

### 👀 Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered

### 📝 Additional context \[optional]
Add any other context or screenshots about the feature request here
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/maintainer_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Maintainer request
about: Request to become a maintainer
title: "<your title here>"
labels: contributing
assignees: 'dmkjfs'

---

### 📝 Describe your request
A clear and concise description of your request.

### ❤️ Describe the reasons
A clear and concise description of why you want this request to be satisfied.

### 📝 Additional context \[optional]
Add any other context.
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Pull request template
about: Create a report about your changes to merge a pull request
title: <ENHANCEMENT|DOCUMENTATION|BUGFIX> <your pull request title here>
labels: enhancement
assignees: ''

---

### ✏️ Short description
A clear and short description of what you changed

### 📜 Changes
1. change 1
2. change 2
3. change 3

📝 Additional context [optional]
Add any other context about the pull request here
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
target-branch: "master"
labels:
- "dependencies"
- "chore"
32 changes: 32 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: check

on:
pull_request:
push:
branches:
- master
- dev/*

jobs:
test:
name: test-${{ matrix.os }}-go${{ matrix.go-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version:
- "1.25"
- "1.24"
os:
- "ubuntu-latest"
- "windows-latest"
- "macos-latest"

steps:
- name: checkout
uses: actions/checkout@v5
- name: setup go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }
- name: run tests
run: go test ./...
38 changes: 8 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,10 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Binaries
bin/

# Test binary, built with `go test -c`
*.test
# Tests
.coverage

# Code coverage profiles and other test artifacts
*.out
coverage.*
*.coverprofile
profile.cov

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work
go.work.sum

# env file
.env

# Editor/IDE
# .idea/
# .vscode/
# Editor/IDE settings
.idea/
.vscode/
.zed/
87 changes: 87 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Contributing guide

🧑‍🦱 Contributions are welcome!

**🗒️ Table of content**

- [Code contribution](#code-contribution)
- Contributing code
- Building the project
- Becoming a maintainer
- [Reporting a bug](#reporting-a-bug)
- Unexpected behavior
- Security issues
- [Feature suggestion](#feature-suggestion)

---

### 👨‍💻 Code contribution

**To contribute code to the project, follow these steps:**

1. Open [issues](https://github.com/statloc/cli/issues) section and choose an issue to work on.
2. Fork the repository on GitHub.
3. Clone your forked repository to your local machine.
4. Create a new branch for your changes.
5. Install dependencies with `make build` (required to have `make` and `go` (version from go.mod) installed)
6. Complete an issue and commit it.
- Follow the [style guide](https://google.github.io/styleguide/go/guide).
- Test your code thoroughly.
- Write clear and concise commit messages.
7. Push your changes to your forked repository.
8. Create a pull request to the main repository.
- Pull request will not be merged until it is approved by a maintainer and passes all checks.

*[List of code contributors] is updated weekly.*

**To make a code contribution, build the project:**

Clone from GitHub
```shell
git clone git@github.com:statloc/cli.git
```

Install dependencies (requires `make` to be installed, `go` version is `1.25.1`)
```shell
make build
```

Run linter and tests
```shell
make
```

**To become a maintainer:**

1. Open an issue from a template.
2. Provide a brief description of your contributions and experience.
3. Wait for a response from the maintainers.

Alternatively, contact one of the maintainers from the [maintainers list](https://github.com/statloc/cli/blob/master/.github/CODEOWNERS) and request a maintainer role.


---

### 🪲 Reporting a bug

**To report an unexpected behavior, follow these steps:**

1. Open an issue from a template.
2. Provide a description of the unexpected behavior following the template.
- Fill as many fields as possible.

**To report a security issue, follow these steps:**

*⚠️ DO NOT REPORT SECURITY ISSUES VIA GITHUB ISSUES!!!⚠️*

To report a vulnerability or any other security issue, please contact any code owner from [this list](https://github.com/statloc/cli/blob/master/.github/CODEOWNERS).

---

### 🤝 Feature suggestion

**To suggest a feature, follow this steps:**

1. Open an issue from a template.
2. Provide a description of the feature following the template.
- Fill as many fields as possible.
5 changes: 5 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"THE COFFEEWARE LICENSE" (Revision 1):

dmkfjs <dmkfjs@gmail.com> wrote this file. As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you think
this stuff is worth it, you can buy me a coffee in return.
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.DEFAULT_GOAL := check

check: lint test build

lint:
go tool golangci-lint run

build:
go mod download
go build -o bin/statloc cmd/main.go

test:
go test ./...

coverage:
go test -coverprofile=.coverage ./...

clean:
rm -f .coverage
go clean -testcache
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,44 @@
# cli
[not released] ⚡🧑‍💻 Command-line interface for statloc, simple and fast.
# statloc cli

<div>
<img src="https://img.shields.io/github/v/release/statloc/cli?sort=semver&display_name=release&style=flat-square&label=latest%20release&color=purple">
<a href="https://github.com/statloc/cli/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-coffeeware-purple?style=flat-square&label=license&color=purple"></a>
<a href="https://github.com/statloc/cli/stargazers/"><img src="https://img.shields.io/github/stars/statloc/cli?style=flat-square&label=stars&color=purple"></a>
<a href="https://github.com/statloc/cli/forks/"><img src="https://img.shields.io/github/forks/statloc/cli?style=flat-square&color=purple"></a>
<a href="https://github.com/statloc/cli/actions/workflows/check.yml/"><img src="https://img.shields.io/github/actions/workflow/status/statloc/cli/check.yml?branch=master&style=flat-square&label=checks&color=purple"></a>
</div>

### ✏️ About
- Command-line interface for statloc
- Simple and fast

### ⚡ Installation
As a go tool
```shell
go get -tool github.com/statloc/cli
```

### 📝 Usage
```shell
statloc project_name/
```

```
+-------------+-------+-------+
| Item | LOC | Files |
+-------------+-------+-------+
| Go | 2339 | 27 |
+-------------+-------+-------+
| Python | 10398 | 112 |
+-------------+-------+-------+
| Rust | 970 | 11 |
+-------------+-------+-------+
| Tests | 4612 | 43 |
+-------------+-------+-------+
| Total | 13737 | 155 |
+-------------+-------+-------+

```

### 🤝 Contributing
Follow our [guide](https://github.com/statloc/cli/blob/master/CONTRIBUTING.md) to contribute to this project
17 changes: 17 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Security Policy

#### 📜 Supported Versions

Here's a list of versions of the project are
currently being supported with security updates.


| Version | Supported |
| ------- | ------------------ |
| 0.1 | :white_check_mark: |

#### ‼️ Reporting a Vulnerability

*⚠️ DO NOT REPORT SECURITY ISSUES VIA GITHUB ISSUES!!! ⚠️*

To report a vulnerability or any other security issue, please contact any code owner from [this list](https://github.com/statloc/cli/blob/master/.github/CODEOWNERS).
Loading