Skip to content

Latest commit

 

History

History
176 lines (111 loc) · 5.05 KB

CONTRIBUTING.md

File metadata and controls

176 lines (111 loc) · 5.05 KB

Contributing to Ultimate Warfare

Thank you for considering contributing to Ultimate Warfare. This document contains some guidelines to explain the contributing process and hopefully answer some common questions.

Do note that almost nothing is set in stone. Feel free to even contribute to this document!

Table of Contents

Before getting started

Prerequisites

Collaboration and contributing will be primarily done through GitHub.

Vision

War game, economy, world map, strategy, free and fun!

How can I contribute?

Participating in the beta

The source code of Ultimate Warfare is playable on this beta server. Enjoy the game and please report all issues/suggestions in the issue tracker.

Reporting bugs

You can report bugs to the issue tracker.

Please search the issue tracker first if the particular bug already has an open issue. If it does, add your message to the existing issue instead of opening a new issue.

If a closed or resolved issue exists for your particular bug, reopen it. If in doubt, just open a new issue.

Collaborating with development

First, make sure the changes you're going to do adhere to the vision of UltimateWarfare.

Fork the repository on GitHub, make a new branch off develop and start from there. Separate features isolated from each other should go in their own branch. Branch names should preferably adhere to the Git Flow workflow using a feature/FeatureName or hotfix/HotfixName notation.

When making changes, add or modify relevant tests with your changes if it involves game mechanic-related code.

Once you're satisfied with your modifications, send me a pull request. I will review it, edit it as needed and merge it with the develop branch.

Local development

Setting up

Assumptions:
  • You have PHP 8.0 or higher installed and in your path.
  • You have Composer installed and in your path.
  • You have a basic understanding of the Symfony framework.
Languages, frameworks, libraries and tools

Ultimate Warfare is built on the Symfony framework, using modern PHP as language and twig as templating language.

I'm developing Ultimate Warfare in PhpStorm myself, but you're of course free to use whatever you see fit.

Cloning the repository:
$ git pull https://github.com/FrankProjects/UltimateWarfare.git UltimateWarfare
$ cd UltimateWarfare
Setup
# Composer stuff
$ composer self-update
$ composer install --prefer-source
Create database and schema
$ bin/console doctrine:database:create
$ bin/console doctrine:schema:create
Load database data
$ bin/console doctrine:migrations:migrate

Directory structure

UltimateWarfare/
├─ assets/
├─ bin/
│  └─ console
├─ config/
├─ public/
│  └─ index.php
├─ src/
│  ├─ Kernel.php
│  ├─ Command/
│  ├─ Controller/
│  ├─ DataFixtures/
│  ├─ Entity/
│  ├─ EventSubscriber/
│  ├─ Form/
│  ├─ Repository/
│  ├─ Security/
│  └─ Twig/
├─ templates/
├─ tests/
├─ translations/
├─ var/
│  ├─ cache/
│  ├─ log/
│  └─ ...
├─ vendor/
└─ .env

How to run tests

You can run tests with:

$ vendor/bin/phpunit

There are two test suites, named as follows:

  • Feature Tests
  • Unit Tests

Feature tests can be seen as user stories if you're familiar with Agile.

Unit test classes are tests that generally correspond to a single source class to test the implementation of the business logic. Unit tests methods should correspond to a matching source class method under test using a testNameOfMethodUnderTest naming convention.

Consult PHPUnit's manual for running specific test suites or individual files.

How to update

For updating your local development environment, do a git pull, optionally followed by a composer install, depending on which files have changed.

Style guide and standards

PHP code should be in PSR12-style.

Please add relevant unit tests or feature tests if possible.