Add a markdownlint pre-commit hook
This adds a pre-commit hook to link Markdown files and fixes all reported findings.
This commit is contained in:
parent
af6cda9073
commit
ae3fad73ce
@ -26,6 +26,7 @@ All details about each step are documented in [ReleaseProcess](wiki/ReleaseProce
|
|||||||
**All the following issues must be fixed in `main` (which closes the issue) and then cherry-picked to the release branch (after that, you can tick the checkbox below).**
|
**All the following issues must be fixed in `main` (which closes the issue) and then cherry-picked to the release branch (after that, you can tick the checkbox below).**
|
||||||
|
|
||||||
Here are the Release Blocking issues currently delaying the release:
|
Here are the Release Blocking issues currently delaying the release:
|
||||||
|
|
||||||
- [x] None currently
|
- [x] None currently
|
||||||
|
|
||||||
## Progress Tracking
|
## Progress Tracking
|
||||||
@ -56,6 +57,7 @@ Here are the Release Blocking issues currently delaying the release:
|
|||||||
---
|
---
|
||||||
|
|
||||||
Before moving on with Full Freeze, make sure that:
|
Before moving on with Full Freeze, make sure that:
|
||||||
|
|
||||||
- [ ] At least 10 days have passed since the string freeze announcement
|
- [ ] At least 10 days have passed since the string freeze announcement
|
||||||
- [ ] Only this ticket remains in the Milestone
|
- [ ] Only this ticket remains in the Milestone
|
||||||
- [ ] All previous checkboxes are ticked
|
- [ ] All previous checkboxes are ticked
|
||||||
|
8
.markdownlint.yaml
Normal file
8
.markdownlint.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
commands-show-output: false
|
||||||
|
default: true
|
||||||
|
no-bare-urls: false
|
||||||
|
line-length:
|
||||||
|
line_length: 100
|
||||||
|
fenced-code-language: false
|
||||||
|
no-space-in-emphasis: false
|
@ -54,3 +54,13 @@ repos:
|
|||||||
- --simplify
|
- --simplify
|
||||||
stages: [pre-commit]
|
stages: [pre-commit]
|
||||||
exclude: ^build/premake/premake5/
|
exclude: ^build/premake/premake5/
|
||||||
|
- repo: https://github.com/igorshubovych/markdownlint-cli
|
||||||
|
rev: v0.41.0
|
||||||
|
hooks:
|
||||||
|
- id: markdownlint
|
||||||
|
exclude: |
|
||||||
|
(?x)(
|
||||||
|
^.gitea/ISSUE_TEMPLATE/|
|
||||||
|
^build/premake/|
|
||||||
|
^source/third_party/
|
||||||
|
)
|
||||||
|
@ -15,7 +15,6 @@ There are several ways to contact us and find more information:
|
|||||||
- Gitea (development info, bug tracker): https://gitea.wildfiregames.com/
|
- Gitea (development info, bug tracker): https://gitea.wildfiregames.com/
|
||||||
- IRC: #0ad on irc.quakenet.org
|
- IRC: #0ad on irc.quakenet.org
|
||||||
|
|
||||||
|
|
||||||
## Running precompiled binaries on Windows
|
## Running precompiled binaries on Windows
|
||||||
|
|
||||||
A precompiled, ready-to-play development version of the game is available from
|
A precompiled, ready-to-play development version of the game is available from
|
||||||
@ -27,33 +26,28 @@ In a checkout of the `nightly-build` SVN repository, open the "binaries\system"
|
|||||||
- To launch the game: Run pyrogenesis.exe
|
- To launch the game: Run pyrogenesis.exe
|
||||||
- To launch the map editor: Run Atlas.bat or "pyrogenesis.exe -editor"
|
- To launch the map editor: Run Atlas.bat or "pyrogenesis.exe -editor"
|
||||||
|
|
||||||
|
|
||||||
## Compiling the game from source code
|
## Compiling the game from source code
|
||||||
|
|
||||||
The instructions for compiling the game on Windows, Linux and OS X are at
|
The instructions for compiling the game on Windows, Linux and OS X are at
|
||||||
[BuildInstructions](https://gitea.wildfiregames.com/0ad/0ad/wiki/BuildInstructions).
|
[BuildInstructions](https://gitea.wildfiregames.com/0ad/0ad/wiki/BuildInstructions).
|
||||||
|
|
||||||
|
|
||||||
## Reporting problems
|
## Reporting problems
|
||||||
|
|
||||||
Bugs should be reported on Gitea. For information on reporting problems
|
Bugs should be reported on Gitea. For information on reporting problems
|
||||||
and finding logs, see [ReportingErrors](https://gitea.wildfiregames.com/0ad/0ad/wiki/ReportingErrors).
|
and finding logs, see [ReportingErrors](https://gitea.wildfiregames.com/0ad/0ad/wiki/ReportingErrors).
|
||||||
|
|
||||||
|
|
||||||
## Contributing Code
|
## Contributing Code
|
||||||
|
|
||||||
If you want to help out programming for the game, have a look at
|
If you want to help out programming for the game, have a look at
|
||||||
[GettingStartedProgrammers](https://gitea.wildfiregames.com/0ad/0ad/wiki/GettingStartedProgrammers)
|
[GettingStartedProgrammers](https://gitea.wildfiregames.com/0ad/0ad/wiki/GettingStartedProgrammers)
|
||||||
or contact us on #0ad-dev on irc.quakenet.org
|
or contact us on #0ad-dev on irc.quakenet.org
|
||||||
|
|
||||||
|
|
||||||
## Contributing Artwork
|
## Contributing Artwork
|
||||||
|
|
||||||
If you want to make artwork for the game, have a look at
|
If you want to make artwork for the game, have a look at
|
||||||
[For Artists](https://gitea.wildfiregames.com/0ad/0ad/wiki#for-artists)
|
[For Artists](https://gitea.wildfiregames.com/0ad/0ad/wiki#for-artists)
|
||||||
or visit [the forums](https://www.wildfiregames.com/forum).
|
or visit [the forums](https://www.wildfiregames.com/forum).
|
||||||
|
|
||||||
|
|
||||||
## Translating
|
## Translating
|
||||||
|
|
||||||
You can help translating the game at https://www.transifex.com/projects/p/0ad
|
You can help translating the game at https://www.transifex.com/projects/p/0ad
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
# Linting
|
# Linting
|
||||||
|
|
||||||
This folder contains tools for linting 0 A.D. code
|
This folder contains tools for linting 0 A.D. code
|
||||||
Linting is done via Arcanist: https://secure.phabricator.com/book/phabricator/article/arcanist_lint/
|
Linting is done via Arcanist:
|
||||||
|
https://secure.phabricator.com/book/phabricator/article/arcanist_lint/
|
||||||
|
|
||||||
## Linters
|
## Linters
|
||||||
|
|
||||||
- `text` is configured to detect whitespace issues.
|
- `text` is configured to detect whitespace issues.
|
||||||
- `json` detects JSON syntax errors.
|
- `json` detects JSON syntax errors.
|
||||||
- `project-name` detects misspellings of the project name "0 A.D.". In particular the non-breaking space.
|
|
||||||
- `licence-year` detects Copyright header years and compares against modification time.
|
- `licence-year` detects Copyright header years and compares against modification time.
|
||||||
- `eslint`, if installed, will run on javascript files.
|
- `eslint`, if installed, will run on javascript files.
|
||||||
- `cppcheck`, if installed, will run on C++ files.
|
- `cppcheck`, if installed, will run on C++ files.
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
This assumes you have arcanist already installed. If not, consult https://trac.wildfiregames.com/wiki/Phabricator#UsingArcanist .
|
This assumes you have arcanist already installed. If not, consult
|
||||||
|
https://trac.wildfiregames.com/wiki/Phabricator#UsingArcanist .
|
||||||
|
|
||||||
The linting is done via custom PHP scripts, residing in `pyrolint/`.
|
The linting is done via custom PHP scripts, residing in `pyrolint/`.
|
||||||
Configuration is at the root of the project, under `.arclint`.
|
Configuration is at the root of the project, under `.arclint`.
|
||||||
@ -26,8 +26,12 @@ We provide dummy replacement for external linters, so that they are not required
|
|||||||
|
|
||||||
#### eslint
|
#### eslint
|
||||||
|
|
||||||
Installation via npm is recommended. The linter assumes a global installation of both eslint and the "brace-rules" plugin.
|
Installation via npm is recommended. The linter assumes a global installation
|
||||||
`npm install -g eslint@latest eslint-plugin-brace-rules`
|
of both eslint and the "brace-rules" plugin.
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install -g eslint@latest eslint-plugin-brace-rules`
|
||||||
|
```
|
||||||
|
|
||||||
See also https://eslint.org/docs/user-guide/getting-started
|
See also https://eslint.org/docs/user-guide/getting-started
|
||||||
|
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
This script checks the game files for missing dependencies, unused files, and for file integrity. If mods are specified, all their dependencies are also checked recursively. This script is particularly useful to detect broken actors or templates.
|
This script checks the game files for missing dependencies, unused files, and for file integrity.
|
||||||
|
If mods are specified, all their dependencies are also checked recursively. This script is
|
||||||
|
particularly useful to detect broken actors or templates.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
@ -20,13 +22,15 @@ Checks the game files for missing dependencies, unused files, and for file integ
|
|||||||
|
|
||||||
options:
|
options:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
-u, --check-unused check for all the unused files in the given mods and their dependencies. Implies --check-map-
|
-u, --check-unused check for all the unused files in the given mods and their dependencies.
|
||||||
xml. Currently yields a lot of false positives.
|
Implies --check-map-xml. Currently yields a lot of false positives.
|
||||||
-x, --check-map-xml check maps for missing actor and templates.
|
-x, --check-map-xml check maps for missing actor and templates.
|
||||||
-a, --validate-actors
|
-a, --validate-actors
|
||||||
run the validator.py script to check if the actors files have extra or missing textures.
|
run the validator.py script to check if the actors files have extra or
|
||||||
|
missing textures.
|
||||||
-t, --validate-templates
|
-t, --validate-templates
|
||||||
run the validator.py script to check if the xml files match their (.rng) grammar file.
|
run the validator.py script to check if the xml files match their (.rng)
|
||||||
|
grammar file.
|
||||||
-m MOD [MOD ...], --mods MOD [MOD ...]
|
-m MOD [MOD ...], --mods MOD [MOD ...]
|
||||||
specify which mods to check. Default to public.
|
specify which mods to check. Default to public.
|
||||||
```
|
```
|
||||||
|
@ -4,7 +4,8 @@ This is a collection of scripts to automate 0 A.D.'s i18n process.
|
|||||||
|
|
||||||
See `maintenanceTasks.sh` for the full process.
|
See `maintenanceTasks.sh` for the full process.
|
||||||
|
|
||||||
### Run tests
|
## Run tests
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pip3 install pytest
|
pip3 install pytest
|
||||||
python3 -m pytest
|
python3 -m pytest
|
||||||
|
@ -1,21 +1,29 @@
|
|||||||
# 0 AD Python Client
|
# 0 AD Python Client
|
||||||
This directory contains `zero_ad`, a python client for 0 AD which enables users to control the environment headlessly.
|
|
||||||
|
This directory contains `zero_ad`, a python client for 0 AD which enables users to control the
|
||||||
|
environment headlessly.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
`zero_ad` can be installed with `pip` by running the following from the current directory:
|
`zero_ad` can be installed with `pip` by running the following from the current directory:
|
||||||
|
|
||||||
```
|
```
|
||||||
pip install .
|
pip install .
|
||||||
```
|
```
|
||||||
|
|
||||||
Development dependencies can be installed with `pip install -r requirements-dev.txt`. Tests are using pytest and can be run with `python -m pytest`.
|
Development dependencies can be installed with `pip install -r requirements-dev.txt`. Tests are
|
||||||
|
using pytest and can be run with `python -m pytest`.
|
||||||
|
|
||||||
## Basic Usage
|
## Basic Usage
|
||||||
|
|
||||||
If there is not a running instance of 0 AD, first start 0 AD with the RL interface enabled:
|
If there is not a running instance of 0 AD, first start 0 AD with the RL interface enabled:
|
||||||
|
|
||||||
```
|
```
|
||||||
pyrogenesis --rl-interface=127.0.0.1:6000
|
pyrogenesis --rl-interface=127.0.0.1:6000
|
||||||
```
|
```
|
||||||
|
|
||||||
Next, the python client can be connected with:
|
Next, the python client can be connected with:
|
||||||
|
|
||||||
```
|
```
|
||||||
import zero_ad
|
import zero_ad
|
||||||
from zero_ad import ZeroAD
|
from zero_ad import ZeroAD
|
||||||
@ -32,7 +40,10 @@ with open('./samples/arcadia.json', 'r') as f:
|
|||||||
state = game.reset(arcadia_config)
|
state = game.reset(arcadia_config)
|
||||||
```
|
```
|
||||||
|
|
||||||
where `./samples/arcadia.json` is the path to a game configuration JSON (included in the first line of the commands.txt file in a game replay directory) and `state` contains the initial game state for the given map. The game engine can be stepped (optionally applying actions at each step) with:
|
where `./samples/arcadia.json` is the path to a game configuration JSON (included in the first
|
||||||
|
line of the commands.txt file in a game replay directory) and `state` contains the initial game
|
||||||
|
state for the given map. The game engine can be stepped (optionally applying actions at each step)
|
||||||
|
with:
|
||||||
|
|
||||||
```
|
```
|
||||||
state = game.step()
|
state = game.step()
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
## Instructions
|
# Instructions
|
||||||
|
|
||||||
Install python 3 and the python dependencies
|
Install python 3 and the python dependencies
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
@ -8,7 +9,7 @@ pip install -r requirements.txt
|
|||||||
Install glslc and spirv-tools 2023+ (the easiest way is to install Vulkan SDK)
|
Install glslc and spirv-tools 2023+ (the easiest way is to install Vulkan SDK)
|
||||||
|
|
||||||
Run the compile.py script
|
Run the compile.py script
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python compile.py path-to-folder-with-input-mods mod-output-path rules-path
|
python compile.py path-to-folder-with-input-mods mod-output-path rules-path
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
## Template Analyzer
|
# Template Analyzer
|
||||||
|
|
||||||
This python tool has been written by wraitii and updated to 0ad A25 by hyiltiz.
|
This python tool has been written by wraitii and updated to 0ad A25 by hyiltiz.
|
||||||
Its purpose is to help with unit and civ balancing by allowing quick comparison
|
Its purpose is to help with unit and civ balancing by allowing quick comparison
|
||||||
@ -9,6 +9,7 @@ installed). The output will be located in an HTML file called
|
|||||||
`unit_summary_table.html` in this folder.
|
`unit_summary_table.html` in this folder.
|
||||||
|
|
||||||
The script generates 3 informative tables:
|
The script generates 3 informative tables:
|
||||||
|
|
||||||
- A comparison table of generic templates;
|
- A comparison table of generic templates;
|
||||||
- A comparison table of civilization units (it shows the differences with the
|
- A comparison table of civilization units (it shows the differences with the
|
||||||
generic templates);
|
generic templates);
|
||||||
@ -30,7 +31,6 @@ used can be found at https://github.com/koalyptus/TableFilter/
|
|||||||
|
|
||||||
All contents of this folder are under the MIT License.
|
All contents of this folder are under the MIT License.
|
||||||
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
The script intentionally only relies on Python 3 Standard Library to avoid
|
The script intentionally only relies on Python 3 Standard Library to avoid
|
||||||
@ -38,32 +38,37 @@ installing 3rd party libraries as dependencies. However, you might want to
|
|||||||
install a few packages to make hacking around easier.
|
install a few packages to make hacking around easier.
|
||||||
|
|
||||||
### Debugging
|
### Debugging
|
||||||
|
|
||||||
IPython can be used as a good REPL and to easily insert a debug break point.
|
IPython can be used as a good REPL and to easily insert a debug break point.
|
||||||
Install it with:
|
Install it with:
|
||||||
|
|
||||||
pip3 install ipython
|
pip3 install ipython
|
||||||
|
|
||||||
then to insert a break point, simply insert the following line to the script where
|
then to insert a break point, simply insert the following line to the script where
|
||||||
you want execution to pause:
|
you want execution to pause:
|
||||||
|
|
||||||
import IPython; IPython.embed()
|
import IPython; IPython.embed()
|
||||||
|
|
||||||
Then, run the script as normal. Once you hit the breakpoint, you can use IPython
|
Then, run the script as normal. Once you hit the breakpoint, you can use IPython
|
||||||
as a normal REPL. A useful IPython magic is `whos`, which shows all local
|
as a normal REPL. A useful IPython magic is `whos`, which shows all local
|
||||||
variables.
|
variables.
|
||||||
|
|
||||||
### Exploration
|
### Exploration
|
||||||
|
|
||||||
To understand the internal logic, generating a function call dependency graph
|
To understand the internal logic, generating a function call dependency graph
|
||||||
can be helpful by providing a quick visual overview. Use the following code to
|
can be helpful by providing a quick visual overview. Use the following code to
|
||||||
create the function call dependency graph. It is dynamic, and allows quickly
|
create the function call dependency graph. It is dynamic, and allows quickly
|
||||||
getting familiarized with the analyzer. Note that you'll need `dot` engine provided
|
getting familiarized with the analyzer. Note that you'll need `dot` engine provided
|
||||||
by the `graphviz` package. You can install `graphviz` using your system's package manager.
|
by the `graphviz` package. You can install `graphviz` using your system's package manager.
|
||||||
|
|
||||||
pip3 install pyan3==1.1.1
|
pip3 install pyan3==1.1.1
|
||||||
python3 -m pyan unitTables.py --uses --no-defines --colored --grouped --annotated --html > fundeps.html
|
python3 -m pyan unitTables.py --uses --no-defines --colored \
|
||||||
|
--grouped --annotated --html > fundeps.html
|
||||||
|
|
||||||
Alternatively, only create the `.dot` file using the following line, and render it with an online renderer like http://viz-js.com/
|
Alternatively, only create the `.dot` file using the following line, and render
|
||||||
|
it with an online renderer like http://viz-js.com/
|
||||||
|
|
||||||
python3 -m pyan unitTables.py --uses --no-defines --colored --grouped --annotated --dot > fundeps.dot
|
python3 -m pyan unitTables.py --uses --no-defines --colored \
|
||||||
|
--grouped --annotated --dot > fundeps.dot
|
||||||
|
|
||||||
Enjoy!
|
Enjoy!
|
||||||
|
Loading…
Reference in New Issue
Block a user