Commit Graph

24090 Commits

Author SHA1 Message Date
028ec40165
Add a RC file to add metadata to the pyrogenesis executable 2024-08-28 23:37:36 +02:00
631f7b292e Add pre-commit hook for shellcheck
Using shellcheck-py[1] instead of the official shellcheck-precommit[2]
to avoid a dependency on docker.

[1] https://github.com/shellcheck-py/shellcheck-py
[2] https://github.com/koalaman/shellcheck-precommit

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-28 18:23:18 +02:00
6f5ac7c4ae Fix issues pointed out by shellcheck
Some are real bugs, some are bashisms, but most is zealous quoting of
variables.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-28 18:23:18 +02:00
0feeb5884a
Cache Python dependencies in pre-commit workflow
This should speed up installation of pre-commit as part of the Gitea
Action a bit, as it caches the Python packages required for it.

The cache functionality of actions/setup-python is unsuitable for this
use case, as we don't have a file with requirements we want to use as
key. Instead, we just want to cache whatever is downloaded via pip from
PyPI and keep it for further invocations. This commit achieves that by
using the same cache key for every workflow run. The cache is being
updated even if pre-commit fails so we always keep the the Python
packages used for installing pre-commit cached.
2024-08-28 07:42:08 +02:00
97e6691c76
Fix Atlas in the nightly build
The Windows autobuilder contains two built versions of wxWidgets. One
corresponds to the oldest supported version of the library, and is used
for CI. However, the nightly build should use a recent version of the
library, compiled with the same toolset as the main game.

This commit adapts the nightly-build pipeline to use the rebuilt recent
copy of wxWidgets.
2024-08-27 21:38:37 +02:00
ea647067f0
Enable ruff rules to check for ambiguous code
This enables some ruff rules to check for ambiguous and dead Python
code, which might cause unintended side-effects.

The enabled rules are:

- a bunch of rules related to shadowing of builtin structures (A)
- a bunch of rules checking for unused arguments (ARG)
- a rule checking for useless expressions (B018)
- a rule checking for unbound loop variables (B023)
- a rule checking redefined function parameters (PLR1704)
2024-08-27 19:28:11 +02:00
ee3318309b
Allow to force non-incremental Jenkins builds
In all the builds using precompiled headers, an update to libraries will
crash the CI, as those headers will become outdated. It is then
necessary to force a full rebuild of the game by cleaning up the
workspaces.

This commit allows this CI behavior to be triggered by specifying
[CLEANBUILD] in the first line of the commit message.
This will constitute an opportunity to inform users that they need to
clean their workspaces when pulling the update.
2024-08-27 17:13:49 +02:00
2a67c9a503
Abort previous builds in pull requests
This will save precious build time by stopping the build of obsolete
commits.
2024-08-27 14:39:19 +02:00
f8ac0e4f68 Run checkrefs.py as Gitea Actions workflow 2024-08-27 13:33:21 +02:00
183a0b13f3 Add .already-built for premake to .gitignore
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-27 12:55:17 +02:00
13da3457bc
Delete wrongly committed file from abdda50892 2024-08-27 12:46:33 +02:00
ae3fad73ce
Add a markdownlint pre-commit hook
This adds a pre-commit hook to link Markdown files and fixes all
reported findings.
2024-08-27 10:06:31 +02:00
af6cda9073 Add shfmt to .pre-commit-config
Run shfmt as part of the ci workflow.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-26 09:03:00 +02:00
a04a5f70c7 Add global .editorconfig
This sets some reasonable defaults for all files.

Adds settings for *.sh files, doubles as configuration for shfmt.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-26 09:03:00 +02:00
abdda50892 Format shell scripts using shfmt
This updates shell scripts to use a consistent style that can be enforced
via pre-commit hook.

As for choosing tabs over spaces, some arguments are:

- tabs can help people with visual impairment
- tabs allow for indenting heredocs in bash
- tabs are the default for the tool shfmt

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-26 09:03:00 +02:00
c763c010b8
Add a bunch of additional pre-commit hooks 2024-08-26 07:46:41 +02:00
1800b5f1c0
Add executable bits for files with shebangs 2024-08-26 07:46:38 +02:00
f58dc9b485
Remove unnecessary executable bits
This removes the executable bits from files which aren't supposed to
have them.

Also removes shebangs for files which aren't supposed to be executable.
2024-08-26 07:46:34 +02:00
05e708f987
Refactor check_* functions for better readability 2024-08-25 21:24:00 +02:00
75949e1f5a
Replace use of os.path with pathlib 2024-08-25 21:24:00 +02:00
4b77d7bb74
Compile regex pattern once
This should slightly increase the performance as the pattern has to be
only compiled once, instead of so during every loop iteration.
2024-08-25 21:24:00 +02:00
87029f2a91
Replace uses of re.split() with str.split() 2024-08-25 21:23:59 +02:00
24e67746f9
Log a warning when a specified mod can't be found 2024-08-25 21:23:59 +02:00
92d92fac1b
Remove unnecessary default value for dict.get() 2024-08-25 21:23:59 +02:00
0dea22285e
Fix the exit codes of checkrefs.py 2024-08-25 21:23:59 +02:00
39f2889cf7
Support calling checkrefs.py from other dirs 2024-08-25 21:23:59 +02:00
f22d0d899e Add final to classes introduced in f9114a87f2
A class which can not be derived from should tell that in the
declaration.
2024-08-25 13:38:09 +02:00
62c0080e1b Don't use std::shared_ptr in CStrIntern
Now there is less allocation and reference counting.
2024-08-25 11:58:22 +02:00
45984c905b Fix get-nightly scripts on Unix
A wrong syntax was used in for loops.
2024-08-25 10:12:21 +02:00
e36c6a31fe
Enable additional ruff rules
In the ruff config file added in #6954 explicitly selecting the ruff
rules to check was missed, resulting in ruff only checking a very small
subset of its available rules. That hasn't been desired, so this is the
first of a series of commits enabling more rules. In this PR all rules
whose violations can be either automatically fixed by ruff or are
trivial to fix manually get enabled. For the follow up PRs it's intended
to focus on one area of rules per PR to gradually improve the Python
code quality.
2024-08-25 06:29:39 +02:00
0ba8ea3429
Update CODEOWNERS
This updates CODEOWNERS to remove owners for the lobby bot code, which
isn't included in this repository anymore. It also adds me for some
areas where I can help with PR reviews.
2024-08-24 13:48:43 +02:00
1f51fcb87f
Add hook for non-breaking space in 0 A.D.
This replaces the existing arclint linter to ensure the project name
does only include a non-breaking space with a pre-commit hook. The regex
to check is slightly different to account for escaped non-breaking
spaces in JavaScript files and to avoid some false-positives.
2024-08-24 13:08:42 +02:00
a44dd59a0c Add some missing headers
When running clang-format which reorders headers, those are the ones
that came up as missing.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-08-24 12:19:52 +02:00
d055090dd2
Add ruff pre-commit hook
Add configuration for pre-commit, ruff as a hook and configuration to
run ruff whenever a pull request is opened or code is pushed.
2024-08-24 10:54:26 +02:00
c49d4eedd0
Lint and format Python files using ruff
To improve quality und uniformity of the included Python code this
lints and formats the included Python files with ruff.
2024-08-24 10:54:26 +02:00
8519eb9b86
Reduce time needed for STUN
In my tests this reduced the time necessary for starting to host a game
or joining a hosted game by ~180ms.
2024-08-23 21:00:15 +02:00
0efaf5ac4b Add common IDE temporary files to gitignore 2024-08-23 19:29:28 +02:00
eeb0f1cce6
Make checkrefs and called scripts return an error 2024-08-23 17:54:56 +02:00
2a06eea08a
Fix checkrefs.py for python 3.12
Fixes #6898
Reported by: @Itms
2024-08-23 15:59:36 +02:00
393ad6c8a6
Improve windows pipeline 2024-08-23 13:08:04 +02:00
a2e0749c01
Fix regression introduced in 5c1195f66a 2024-08-21 19:17:50 +02:00
7786ef8def
Add Free BSD pipeline. 2024-08-21 19:17:35 +02:00
0b7da91992 Adapt libraries scripts to the new SVN repo. 2024-08-20 20:58:09 +02:00
c7702cefb0 Issue templates (for tickets and release process). 2024-08-20 19:35:56 +02:00
a4ca047535 Add code owners, adapted from Phabricator. 2024-08-20 19:35:42 +02:00
270a48b37d Adapt Jenkins Pipelines to the new build system. 2024-08-20 19:34:28 +02:00
0dd48ec57e Convert README to Markdown and update contents. 2024-08-20 19:19:50 +02:00
e9d1cb6cc7 Generate nightly SVN builds for end users, fixes #1819. 2024-08-20 19:15:56 +02:00
b698558102 Get rid of svnversion. 2024-08-20 19:10:54 +02:00
459ffa18cf Get rid of the Phabricator workflow. 2024-08-20 19:10:39 +02:00