Thank you for your interest in contributing to Natilius! This guide will help you get started.
# Fork and clone
git clone https://github.com/YOUR_USERNAME/natilius.git
cd natilius
# Set up development environment
make dev-setup
# Create a branch
git checkout -b feature/your-feature
# Make changes, then test
make test
make lint
# Commit and push
git add .
git commit -m "feat: add your feature"
git push origin feature/your-featureThen open a Pull Request on GitHub.
- macOS (for full testing)
- Git
- Homebrew (recommended)
make dev-setupThis installs:
bats-core— Bash testing frameworkshellcheck— Shell script linterpre-commit— Git hooks for code quality
natilius/
├── natilius.sh # Main entry point
├── install.sh # Installer script
├── uninstall.sh # Uninstaller script
├── lib/ # Shared library functions
│ ├── utils.sh # Core utilities
│ ├── logging.sh # Logging functions
│ ├── config_validator.sh # Config validation
│ └── network_utils.sh # Network operations
├── modules/ # Feature modules
│ ├── system/ # System modules
│ ├── applications/ # App installation modules
│ ├── dev_environments/ # Language setup modules
│ ├── ide/ # IDE setup modules
│ └── preferences/ # System preferences
├── profiles/ # Pre-built config profiles
├── tests/ # Test suites
├── docs/ # Documentation
└── completions/ # Shell completions
- Use Bash 3.2+ — macOS ships with Bash 3.2
- Pass ShellCheck — All scripts must pass
shellcheck -x - Use
set -euo pipefail— For robust error handling - Quote variables — Always quote
"$variables" - Use
[[over[— More robust conditionals
# Function naming: lowercase with underscores
my_function_name() {
local var_name="value" # Local variables
# ...
}
# Constants: uppercase
readonly MY_CONSTANT="value"
# Prefer long options for clarity in scripts
curl --silent --fail --location "$url" # Not: curl -sfL
# Error messages to stderr
log_error "Something went wrong" >&2Follow Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional footer]
Types:
feat:— New featurefix:— Bug fixdocs:— Documentation onlystyle:— Formatting, no code changerefactor:— Code change that neither fixes nor addstest:— Adding or updating testschore:— Maintenance tasks
Examples:
feat(python): add support for Python 3.12
fix(homebrew): handle missing taps gracefully
docs(readme): update installation instructions
# All tests
make test-all
# Unit tests only
make test
# Integration tests
make integration-test
# Config validation tests
make test-config
# Specific test file
bats tests/test_natilius.batsTests use BATS (Bash Automated Testing System).
# tests/test_example.bats
setup() {
# Runs before each test
source lib/utils.sh
}
teardown() {
# Runs after each test
}
@test "my_function returns success" {
run my_function "arg1"
[ "$status" -eq 0 ]
}
@test "my_function outputs expected result" {
run my_function "input"
[ "$output" = "expected output" ]
}make coverageModules are self-contained scripts that handle specific setup tasks.
#!/bin/bash
# natilius - Module Name
# Description of what this module does
#
# Copyright (C) 2024 Vincent Koc (@vincent_koc)
# License: GPL-3.0-or-later
# ============================================================================
# MODULE: module_name
# Description: Brief description
# Dependencies: homebrew (optional - list required modules)
# Config: VARIABLE_NAME (optional - list config variables used)
# ============================================================================
log_info "Starting module_name setup..."
# Check prerequisites
if ! command -v required_tool &> /dev/null; then
log_warning "required_tool not found, skipping module"
return 0
fi
# Idempotent check
if [ -f "$HOME/.already_configured" ]; then
log_success "module_name already configured, skipping"
else
# Main logic here
log_success "module_name setup complete"
fi- Be idempotent — Safe to run multiple times
- Check prerequisites — Verify dependencies exist
- Use logging —
log_info,log_success,log_warning,log_error - Handle errors gracefully — Don't crash the entire setup
- Document dependencies — List required modules in header
-
Test thoroughly
make test-all make lint
-
Update documentation if needed
-
Add tests for new functionality
-
Run pre-commit hooks
make precommit
- One feature per PR — Keep changes focused
- Descriptive title — Use conventional commit format
- Fill out PR template — Describe changes and testing
- Link issues — Reference related issues with
Fixes #123
Include:
- macOS version (
sw_vers) - Architecture (
uname -m) - Natilius version (
natilius version) - Steps to reproduce
- Expected vs actual behavior
- Relevant log output
Include:
- Use case description
- Proposed solution
- Alternatives considered
Please read and follow our Code of Conduct.
By contributing, you agree that your contributions will be licensed under the GPL-3.0 License.
Thank you for contributing!