Skip to content

Commit

Permalink
feat: Header layouts and styling improvements (#127)
Browse files Browse the repository at this point in the history
* Update project config settings.

* Update doc site pages.

* Improve header layouts and styling.

* Mock env vars.

* Add mock env vars.
  • Loading branch information
eli64s authored Jan 2, 2025
1 parent 0ae4a8f commit aaeb55c
Show file tree
Hide file tree
Showing 398 changed files with 43,477 additions and 18,901 deletions.
89 changes: 42 additions & 47 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,70 +1,65 @@
# Build artifacts
# Build Artifacts
build/
dist/
*.egg-info/

# Compiled Python files
# Compiled Python Files
*.pyc
*.pyo
__pycache__/

# Virtual environment
.venv/
.env

# System-specific files
.DS_Store

# Temporary files
*~

# Logging
logs/
*.log

# Testing
noxfile.py
.nox/
.coverage
.coverage.*
coverage.xml
htmlcov/
tests/
setup/
scripts/
# Documentation and Markdown
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
docs/
examples/
mkdocs.yml
site

# Git
.github/
.git/
.github/
.gitignore

# Markdown
CODE_OF_CONDUCT.md
CONTRIBUTING.md
CHANGELOG.md

# Jupyter Notebook
.ipynb_checkpoints/
outputs/
notebooks/
outputs/

# VSCode workspace settings
.vscode/
# Logging
logs/
*.log

# Python Tools
# Python Tools and Caches
.mypy_cache/
.pytest_cache/
.ruff_cache/

# Mkdocs
.cache
docs/
examples/
mkdocs.yml
site
# System-Specific Files
.DS_Store

# Temporary Files
*~

# Testing
*coverage*
.nox/
.reports/
scripts/
setup/
tests/
noxfile.py

# Virtual Environment
.env
.venv/

# VSCode Workspace Settings
.vscode/

# Work In Progress (WIP)
readmeai/cli/commands_line.py
readmeai/cli/interactive.py
readmeai/config/settings/prompts
readmeai/config/settings/templates
# README-AI
.readmeai/
.actrc
.github/workflows/update-badges-local.yml
.github/workflows/update-badges.yml
65 changes: 31 additions & 34 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,53 +1,50 @@
# Build artifacts
# Build Artifacts
*.egg-info/
build/
dist/
*.egg-info/

# Compiled Python files
# Compiled Python Files
*.pyc
*.pyo
__pycache__/

# Virtual environment
.venv/
.env

# System-specific files
.DS_Store

# Temporary files
*~

# Logging
logs/
*.log

# Testing
.nox/
.coverage
.coverage.*
coverage.xml
htmlcov/
# Documentation and MkDocs
.cache
site

# Jupyter Notebook
.ipynb_checkpoints/
outputs/
notebooks/

# VSCode workspace settings
.vscode/
# Logging
*.log
logs/

# Python Tools
.mypy_cache/
.pytest_cache/
.ruff_cache/

# Mkdocs
.cache
site
# System-Specific Files
.DS_Store

# Temporary Files
*~

# Testing
.nox/
.reports/
*coverage*

# Virtual Environment
.env
.venv/

# VSCode Workspace Settings
.vscode/

# Work In Progress (WIP)
readmeai/cli/commands_line.py
readmeai/cli/interactive.py
readmeai/config/settings/prompts
readmeai/config/settings/templates
# README-AI
.readmeai/
.actrc
.github/workflows/update-badges-local.yml
.github/workflows/update-badges.yml
8 changes: 3 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# https://pre-commit.com/

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand All @@ -13,8 +11,8 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.8.4
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- id: ruff
args: [ --fix ]
26 changes: 20 additions & 6 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ exclude = [
".venv",
".vscode",
]
line-length = 79
line-length = 88
indent-width = 4
target-version = "py310"
target-version = "py311"

[lint]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
extend-select = ["E501"]
preview = true
extend-select = [
"E305", # 2 blank lines before class or function
]
select = [
"ARG", # unused arguments
"B", # flake8-bugbear
"E", # pycodestyle
"E303", # too many blank lines
"E722", # bare except statements
"F", # pyflakes
"F401", # remove unused imports
Expand All @@ -31,6 +33,10 @@ select = [
"RUF", # ruff
"SIM", # flake8-simplify
"UP", # pyupgrade
"W", # pycodestyle
"W291", # trailing whitespace
"W293", # blank line contains whitespace
# "F821", # undefined name
]
fixable = ["ALL"]
ignore = [
Expand All @@ -40,10 +46,18 @@ ignore = [
]
unfixable = []

[lint.isort]
known-third-party = ["readmeai"]
relative-imports-order = "closest-to-furthest"

# [lint.pydocstyle]
# convention = "numpy"

[format]
docstring-code-format = true
docstring-code-line-length = "dynamic"
docstring-code-line-length = 88
indent-style = "space"
line-ending = "auto"
preview = true
quote-style = "double"
skip-magic-trailing-comma = false
99 changes: 62 additions & 37 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,64 +1,89 @@
SHELL := /bin/bash
SRC_PATH := readmeai
TEST_PATH := tests
TARGET := readmeai
TARGET_TEST := tests
PYPROJECT_TOML := pyproject.toml

# -- Development --------------------------------------------------------------


.PHONY: clean
clean: ## Remove project build artifacts
./scripts/clean.sh clean
clean: ## Clean project files
./scripts/clean.sh clean-pyc


# -- Documentation ----------------------------------------------------------------------


.PHONY: docs
docs: ## Build and serve Mkdocs documentation
cd docs && mkdocs build && mkdocs serve


# -- Docker --------------------------------------------------------------------

.PHONY: conda-recipe
conda-recipe: ## Create conda recipe for conda-forge
grayskull pypi readmeai
conda build .

.PHONY: docker-build
docker-build: ## Build Docker image for application
docker build -t zeroxeli/readme-ai:latest .

.PHONY: poetry-install
poetry-install: ## Install dependencies using Poetry.

# -- Poetry --------------------------------------------------------------------


.PHONY: install
install: ## Install project dependencies using Poetry
poetry install

.PHONY: poetry-remove-environment
poetry-remove-environment: ## Removes Poetry virtual environment and lock file.
.PHONY: rm-environment
rm-environment: ## Remove Poetry virtual environment.
poetry env remove --all && rm poetry.lock

.PHONY: poetry-shell
poetry-shell: ## Launch a shell within Poetry virtual environment.
.PHONY: shell
shell: ## Start a shell within the Poetry virtual environment
poetry shell

.PHONY: poetry-to-requirements
poetry-to-requirements: ## Export poetry requirements to requirements.txt
.PHONY: to-requirements
to-requirements: ## Export Poetry dependencies to requirements.txt
poetry export -f requirements.txt --output setup/requirements.txt --without-hashes

.PHONY: ruff-format
ruff-format: ## Format codebase using Ruff
ruff check --select I --fix .
ruff format .

.PHONY: ruff-lint
ruff-lint: ## Lint codebase using Ruff
ruff check . --fix
# -- Code Quality --------------------------------------------------------------

.PHONY: run-mkdocs
run-mkdocs: ## Run the MkDocs server
cd docs && mkdocs serve

.PHONY: search
search: ## Search for a word in the codebase
grep -Ril ${WORD} readmeai tests scripts setup
.PHONY: format
format: ## Format codebase using Ruff
poetry run ruff format $(TARGET)

.PHONY: lint
lint: ## Lint codebase using Ruff
poetry run ruff check $(TARGET) --fix


# -- Testing -------------------------------------------------------------------


.PHONY: test
test: ## Run unit tests using pytest
poetry run pytest
test: ## Run test suite using Pytest
poetry run pytest $(TARGET_TEST) --config-file $(PYPROJECT_TOML)

.PHONY: test-nox
test-nox: ## Run test suite against multiple Python versions
test-nox: ## Run test suite using Nox
nox -f noxfile.py


# -- Utilities ----------------------------------------------------------------


.PHONY: search
search: ## Search for a word across project files
grep -Ril ${WORD} $(TARGET) docs tests

.PHONY: help
help: Makefile ## Display the help menu
@echo -e ""
@echo -e "Usage: make [target]"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo -e "__________________________________________________________________________________________\n"
help: ## Display this help
@echo ""
@echo "Usage: make [target]"
@echo ""
@awk 'BEGIN {FS = ":.*?## "; printf "\033[1m%-20s %-50s\033[0m\n", "Target", "Description"; \
printf "%-20s %-50s\n", "------", "-----------";} \
/^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-20s\033[0m %-50s\n", $$1, $$2}' $(MAKEFILE_LIST)
@echo ""
Loading

0 comments on commit aaeb55c

Please sign in to comment.