UP (Unified Properties)

A Human-Friendly Data Serialization Format

View the Project on GitHub uplang/spec

Thank you for your interest in contributing to UP! This document provides guidelines and information for contributors.

How to Contribute

Reporting Issues

Suggesting Features

Contributing Code

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Commit with clear messages (git commit -m 'Add amazing feature')
  7. Push to your fork (git push origin feature/amazing-feature)
  8. Open a Pull Request

Development Setup

Go Implementation

# Clone the repository
git clone https://github.com/uplang/spec
cd up

# Install dependencies
go mod download

# Build
make build

# Run tests
go test ./...

# Run linter
golangci-lint run

Language Parsers

Each parser in parsers/ has its own build system:

# JavaScript/TypeScript
cd parsers/javascript
npm install
npm test

# Python
cd parsers/python
pip install -e .
python -m pytest

# Rust
cd parsers/rust
cargo build
cargo test

# C
cd parsers/c
make
make test

Code Style

Go

Other Languages

Testing

Adding Tests

Running Tests

# Go tests
go test ./...

# Integration tests with examples
for file in examples/*.up; do
    ./bin/up validate -i "$file"
done

Documentation

Updating Documentation

Writing Examples

Grammar Changes

If proposing changes to the UP language:

  1. Update grammar/GRAMMAR.md with formal specification
  2. Update all grammar files:
    • grammar/up.y (Bison/Yacc)
    • grammar/up.l (Flex)
    • grammar/up.g4 (ANTLR4)
    • grammar/up.peg (PEG)
    • grammar/grammar.js (Tree-sitter)
  3. Update all parser implementations
  4. Add examples demonstrating the feature
  5. Update documentation

Parser Implementation Guidelines

When implementing a UP parser in a new language:

Structure

parsers/<language>/
├── README.md          # Usage and installation
├── parser files       # Implementation
├── tests/            # Unit tests
└── examples/         # Language-specific examples

Requirements

Testing

Ensure your parser correctly handles:

Commit Messages

Use clear, descriptive commit messages:

Add Python parser implementation

- Implement full UP parser in Python
- Add unit tests
- Add setup.py for pip installation
- Update README with Python usage

Format:

Pull Request Process

  1. Ensure all tests pass
  2. Update documentation
  3. Add examples if needed
  4. Fill out PR template
  5. Request review from maintainers
  6. Address feedback
  7. Wait for approval and merge

Areas for Contribution

High Priority

Medium Priority

Low Priority

Community

License

By contributing, you agree that your contributions will be licensed under the MIT License.

Questions?

Thank you for contributing to UP!