Skip to content

Instantly share code, notes, and snippets.

View hectorcanto's full-sized avatar

Héctor Canto hectorcanto

View GitHub Profile
@hectorcanto
hectorcanto / README.template2.md
Last active August 17, 2025 10:37
This a README template which can be used as it is or rendering it with Copier or Jinja. It refers the main pillars of software development: Code, Testing, Documentation, Deployment, Observability, Data and Automation

{{ project_title }}

Company Name

python3 since|2025/08

pipeline status

@hectorcanto
hectorcanto / Makefile
Last active August 16, 2025 23:16
This is a combination of several Makefiles I've been using over the last years that enhance my development experience over the terminal. This works best with other tools like bash aliases, pre-commit, IDE shortcuts and else
#!/usr/bin/make -f
# Run `make` or `make help` to get the list
# Rename or reference them at your own
# Recommendation, group them to enhace autocompletion, like `lint-something`
# Use `@` at the beggining of a line to hide it from prompting
# Most commands are configured through pyproject.toml by default or explicitly
#### Setup
@hectorcanto
hectorcanto / vocabulary.README.md
Last active January 11, 2025 22:25
Vocabulary

A list of software engineering vocabulary in English, Spanish, and Portuguese as I found them in my day to day

@hectorcanto
hectorcanto / docstring.py
Created September 1, 2024 14:00
Google-style docstring exception with personal annotations
"""This is the docstring main line, I prefere them without a final dot
Descritption goes after a brealine, first line should not be multiline but second can be.
After it there can be many section like: Example, Usage, Returns, Attributes, Todo ... There
might special notation for documentation tooling like Sphinx or Handsdown. In general avoid
Avoid `Attributes` and `Returns` typing if specified in the hinting unless it is necessary for the tooling.
This is based in: [Sphinx Napoleon](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)
@hectorcanto
hectorcanto / share.md
Last active August 16, 2025 23:20
Shareable content under GitHub

Overview

This is a list of shareable things under my GitHub account, Slideshare, Youtube, and other sources. You can find content about:

  • Testing
  • Templates of several types
  • Architecture decission records
  • Tooling snippets like Makefiles
  • Serverless architecture
@hectorcanto
hectorcanto / branch_gen.sh
Last active August 11, 2024 15:14
Branch name generator
#!/usr/bin/env bash
# SYNTAX branchtype/[subproject/]description_with_underscore-#CODE-123
# Example feature/main_api/new_feature-#MAPI-123
# Separators: slash (/) dash (-), don't use dashes as spaces, please
# Why this syntax?
# ticket at the end to keep autocomplete working in terminal
# optional subproject for better CI pipeline decissions per subproject (multirepo, subapps, contexts ..)

Keybase proof

I hereby claim:

  • I am hectorcanto on github.
  • I am hcanto_cin (https://keybase.io/hcanto_cin) on keybase.
  • I have a public key ASDJSGfwdj2HKLYnaKBFpNG9G72qZC_HfltgDs1901IsrAo

To claim this, I am signing this object:

@hectorcanto
hectorcanto / conftest.py
Last active December 1, 2020 16:18
Automatic markers
def pytest_collection_modifyitems(items):
"""
Add marker to all tests in the conftest folder tree.
You need to organize your tests in folders for it to work.
Usage: `pytest -m $marker_expression`
Example: `pytest -m unit1
Reference: https://docs.pytest.org/en/stable/reference.html?highlight=collection_modi#pytest.hookspec.pytest_collection_modifyitems
@hectorcanto
hectorcanto / Makefile
Created November 11, 2020 11:56
A curated Makefile for a Python repository, with commands for using several code quality and security tools like Pylint, Flake, Bandit, Trivy ... Assumes everything is installed, a full demo repo is pending (it is a promise)
# https://misc.flogisoft.com/bash/tip_colors_and_formatting
RED="\\e[91m"
GREEN="\\e[32m"
BLUE="\\e[94m"
YELLOW="\\e[33m"
REGULAR="\\e[39m"
REPORTS=".coverage-reports"
SRC="app"
VERSION=$(shell cat ${SRC}/__init__.py | head -n 1 | cut -d" " -f 3 | tr -d "'")
app: for application, many things are considered an application. Use adjectives like web_app, phone_app, django_app
api: application programming interface (any communication protocol may be labelled an API, user rest_api when possible)
rel: relation or relative?
srv: server or service?