Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickkirschen committed Jan 29, 2024
0 parents commit 18d6880
Show file tree
Hide file tree
Showing 18 changed files with 595 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 120
tab_width = 4
trim_trailing_whitespace = true

[{*.md, LICENSE}]
max_line_length = 80
34 changes: 34 additions & 0 deletions .github/commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module.exports = {
rules: {
'body-leading-blank': [2, 'always'],
'body-max-line-length': [2, 'always', 100],
'header-max-length': [2, 'always', 100],
'scope-case': [2, 'always', 'lower-case'],
'subject-case': [
2,
'never',
['start-case', 'pascal-case', 'upper-case'],
],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'type-enum': [
2,
'always',
[
'chore',
'build',
'ci',
'docs',
'feat',
'feat!',
'fix',
'perf',
'refactor',
'test'
],
],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'signed-off-by': [2, 'always']
}
};
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2

updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
23 changes: 23 additions & 0 deletions .github/workflows/commit-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint commit message

on: [push]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Clone
uses: actions/checkout@v3

- name: Setup node 16
uses: actions/setup-node@v3
with:
node-version: "16"
check-latest: true

- name: Install commitlint
run: npm install -g @commitlint/cli @commitlint/config-conventional

- name: Lint commit message
run: echo "${{ github.event.head_commit.message }}" | commitlint --config .github/commitlint.config.js
23 changes: 23 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Push

on: [push]

jobs:
Linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install dependencies
run: python -m pip install --upgrade pip flake8 wheel

- name: Build
run: python setup.py bdist_wheel build

- name: Code linting
run: flake8 . --count --select=E9,F63,F7,F82 --show-source --exit-zero --max-complexity=10 --max-line-length=140 --statistics
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
release:
types:
- created

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v3

- name: Setup Python 3
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 wheel twine
- name: Install packages
run: python3 setup.py bdist_wheel install

- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py bdist_wheel
twine upload dist/*
160 changes: 160 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

.DS_Store
.idea/
*.iml
.settings
.classpath
.project
2 changes: 2 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[FORMAT]
max-line-length=140
11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"recommendations": [
"streetsidesoftware.code-spell-checker",
"editorconfig.editorconfig",
"davidanson.vscode-markdownlint",
"ms-python.python",
"sonarsource.sonarlint-vscode",
"wayou.vscode-todo-highlight",
"redhat.vscode-yaml"
]
}
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"cSpell.language": "en",
"editor.formatOnSave": true,
"editor.wordWrap": "on",
"editor.rulers": [
80,
120
],
"cSpell.words": [
"pytest",
"tidydev"
],
"autopep8.args": [
"--max-line-length=140"
]
}
8 changes: 8 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "failure"
},
"issueSettings": {
"minSeverityLevel": "LOW"
}
}
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# tidydev

[![Lint commit message](https://github.com/yannickkirschen/tidydev/actions/workflows/commit-lint.yml/badge.svg)](https://github.com/yannickkirschen/tidydev/actions/workflows/commit-lint.yml)
[![pytest](https://github.com/yannickkirschen/tidydev/actions/workflows/push.yml/badge.svg)](https://github.com/yannickkirschen/tidydev/actions/workflows/push.yml)
[![release](https://github.com/yannickkirschen/tidydev/actions/workflows/release.yml/badge.svg)](https://github.com/yannickkirschen/tidydev/actions/workflows/release.yml)
[![GitHub release](https://img.shields.io/github/release/yannickkirschen/tidydev.svg)](https://github.com/yannickkirschen/tidydev/releases/)

tidydev is a Python package that provides a set of tools to make your development life easier. It allows analyzing
a directory of git and non-git directories.

## Installation

```bash
pip install tidydev
```

## Usage

```text
Usage: tidydev <commands>
Available commands:
help - show this help
version - show version
analyze <path> - analyze the given path for git repositories and build files
```
12 changes: 12 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[metadata]
name = tidydev
description = Clean up your development directory.
long_description = file: README.md
long_description_content_type = text/markdown
license = Public Domain
version = 1.0.0

[options]
zip_safe = False
include_package_data = True
packages = find:
Loading

0 comments on commit 18d6880

Please sign in to comment.