Skip to content

Commit

Permalink
Merge pull request #14 from henriquesebastiao/dev
Browse files Browse the repository at this point in the history
Preparing for version v1.3.0
  • Loading branch information
henriquesebastiao committed Jul 8, 2024
2 parents 863de3e + 0f80515 commit 99502cd
Show file tree
Hide file tree
Showing 16 changed files with 2,178 additions and 381 deletions.
5 changes: 4 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates managed by Composer once a week
interval: "daily"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
21 changes: 19 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ name: CI
on: [push, pull_request]

jobs:
lint:
linters:
name: Lint
strategy:
fail-fast: false
matrix:
python-version: [ 3.12 ]
check: [ruff, blue]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -19,4 +23,17 @@ jobs:
- name: Run cppcheck
run: |
cppcheck --error-exitcode=1 --force --language=c++ src/*.h
cppcheck --error-exitcode=1 --force --language=c++ src/*.h
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config virtualenvs.create false
poetry install
- name: Run Python checks
run: |
task ${{ matrix.check }}
187 changes: 186 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,189 @@ build/
# Development
dev/

.ruff_cache/
.ruff_cache/

mac-prefixes
nmap-mac-prefixes

changelog.md

# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python

### Python ###
# 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/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

### Python Patch ###
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
poetry.toml

# ruff
.ruff_cache/

# LSP config files
pyrightconfig.json

# End of https://www.toptal.com/developers/gitignore/api/python

# Generated using ignr.py - github.com/Antrikshy/ignr.py

10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ monitor:
arduino-cli monitor --port $(PORT)

format:
clang-format -i --style=google src/*.h
clang-format -i --style=google src/*.h && blue .

format-raw:
python scripts/format_raw.py -f dev/input.txt
Expand All @@ -31,7 +31,10 @@ black:
black .

lint:
cppcheck --error-exitcode=1 --force --language=c++ src/*.h
cppcheck --check-level=exhaustive --error-exitcode=1 --force --language=c++ src/*.h && blue --check . --diff && ruff check .

mac-prefixes:
rm mac-prefixes && wget https://raw.githubusercontent.com/nmap/nmap/master/nmap-mac-prefixes && mv nmap-mac-prefixes mac-prefixes && rm src/macprefixes.h && python scripts/generate_mac_file.py && clang-format -i --style=google src/macprefixes.h

.PHONY: html-lint
.PHONY: upload
Expand All @@ -43,4 +46,5 @@ lint:
.PHONY: format-pronto
.PHONY: format-ir
.PHONY: black
.PHONY: lint
.PHONY: lint
.PHONY: mac-prefixes
32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[tool.poetry]
name = "saturn"
version = "0.1.0"
description = "Firmware to do cool things with Cardputer."
authors = ["Henrique Sebastião <contato@henriquesebastiao.com>"]
license = "GPL-3.0"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.12"
esptool = "^4.7.0"


[tool.poetry.group.dev.dependencies]
ignr = "^2.2"
ruff = "^0.5.1"
taskipy = "^1.13.0"
blue = "^0.9.1"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.ruff]
line-length = 79

[tool.ruff.format]
quote-style = "single"

[tool.taskipy.tasks]
blue = "blue --check . --diff"
ruff = "ruff check ."
Loading

0 comments on commit 99502cd

Please sign in to comment.