1
0
Fork 0
Commit graph

76 commits

Author SHA1 Message Date
krcroft
a852fe3eab Make MD docs comply with markdownlint 2020-01-07 19:28:12 +01:00
krcroft
312a763509 Verify Markdown documents in linting workflow
Also re-order to perform shellcheck first because it
requires the least installation work compared to pylint
and markdownlint.  The reason being if we're going to fail
during shellcheck, then we fail faster (and leave heavier
tasks for further down the line).
2020-01-07 19:28:12 +01:00
Patryk Obara
3be0409d25 Update copyright line in several scripts
Use the exact formatting suggested in COPYING file.

This change is basically a pretext to trigger a new clean build in
order to check if Coverity is capable of accepting new builds for
analysis finally.
2020-01-03 17:15:25 +01:00
Patryk Obara
ce7c27a48b Remove irrelevant ifdefs from unifdef-all script
OS/2 and DirectDraw support were removed during upgrade to SDL2.
2019-12-26 03:23:19 +01:00
Patryk Obara
44c7fb9165 Update CI to target SDL2 2019-12-26 03:23:19 +01:00
Patryk Obara
55b716f8ce Reverse sort by count and item name in the summary
When two files have the same number of warnings, they will appear
in the same order in the summary, making the diff between different
build logs smaller.
2019-12-12 21:24:40 +01:00
Patryk Obara
3b5c3beacf Add an option to list all warnings
Sorted list makes it easier to make a diff of two build logs.
2019-12-12 21:24:40 +01:00
Patryk Obara
c422854482 Add an option to group warnings by files
This change makes it easier to track code areas, that require attention.
2019-12-12 21:24:40 +01:00
Patryk Obara
1f67a5ee7a Set the default max limit of warnings to 0
Most linters behave this way, so it will fit the users' expectations.

Make -m optional, this makes the script a little bit easier to use.
Behaviour of MAX_WARNINGS and using -1 to disable the check is
preserved.
2019-12-12 21:24:40 +01:00
krcroft
d22d48b527 Add all OSes to the workflow 2019-12-11 20:30:19 +01:00
krcroft
343c85fa17 Add empty file to hide automator warning 2019-12-11 20:30:19 +01:00
krcroft
be4d063415 Allow extra arguments to become ./configure flags 2019-12-11 20:30:19 +01:00
krcroft
4a2eacc014 Add ability to exclude packages by pattern 2019-12-11 20:30:19 +01:00
krcroft
d12172b8a4 Add ncurses to installer packages 2019-12-11 20:30:19 +01:00
krcroft
eb9c0a8ec3 Ensure make uses ASCII-only characters 2019-12-11 20:30:19 +01:00
krcroft
92266db4f6 Add "warnmore" build-type to the build script 2019-12-11 20:30:19 +01:00
krcroft
5beac8e310 Remove unecessary string quotes 2019-12-11 20:30:19 +01:00
krcroft
7fe6f7f04c Add -DNDEBUG to common release flags 2019-12-11 20:30:19 +01:00
krcroft
b55b43f543 Use PRIuPTR and define it for Windows GCC 64-bit 2019-12-03 05:12:28 +01:00
Patryk Obara
719536341d Use make's output-sync to prevent log corruption
This works out of the box on Linux and MSYS2, but does not work on
macOS - Xcode supplied make does not support this option, so GNU make is
used instead.

Unfortunately, adding new package on macOS did not invalidate the cache,
this package removes the brew cache from macOS job to avoid this problem
in the future.

Fixes: #53
2019-11-26 04:48:16 +01:00
krcroft
0f11ab8ecb Refactor the build and list-packages scripts
Until now the build and package scripts have supported
several architectures, compilers, build types, package-managers,
and bit-depth targets.

The code might be maintainable if left as-such, however we have plans
to continue expanding the number of architectures (ARM, PPC, ... ),
operating systems (Android, BSDs, ...), and build variations
amung those.

The scripts (regardless of language) would only grow in complexity
as more variations are added. Thus, we needed a solution that can
scale without adding complexity.

To achieve this, the scripts were refactored as follows:
 - all "data" was moved out of code into configuration files
 - A back-end "Automator" engine was written to parse the
   data based on generic variables fed to it by a front-end
   script
 - build.sh and list-packages.sh were re-authored as thin front-end
   scripts that drive the automator
 - Their CLI's were retained so there has been very little change
   needed to the CI invocation lines.  The only changes have been to
   clarify the existing arguments improved based on feedback, ie:
   --build-type release, --build-type debug instead of fast, small
2019-11-24 15:16:44 +01:00
krcroft
fd74aa0720 Allow maximum-issues to be set via command-line
This change allows the maximum issues to be passed in as an argument.
If nothing is passed, then the existing build-in maximum is
used.

Retaining the existing built-in value makes sense for home
users to keep track of their local build (otherwise they would have
to remember the prior number of warnings and pass that value
in for subsequent builds).

Motivation: until now the built-in maximum covers the build permutation
that happens to generate the most warnings versus other builds.
In some cases new warnings may not be cause if they elicit a warning
from the lesser-warning build(s) or compilers, but not in the
maximum-warning build.

This change lets us tighten-down the warning uniquely for each build,
so we can be sure all new warnings are flagged to the developer.
2019-11-24 15:16:44 +01:00
Patryk Obara
e5d43e1b8f Update allowed warnings limit 2019-11-23 18:46:05 +01:00
Patryk Obara
63c946a79c Update allowed warnings limit 2019-11-16 04:31:19 +01:00
Patryk Obara
5b99e786f0 Colorize linter output 2019-11-16 02:27:24 +01:00
Patryk Obara
9a296eded9 Force python3 pylint
Some distributions provide python2 version of pylint package by default,
but all provide pylint for python3 in some package.  Python 2 reaches
EOL in few months, so there's no reason to support it.

This prevents our scripts from being accidentally marked invalid due to
language changes between python 2 and 3.  Also, newer pylint has nicer
output, that provides exact module filename straight in the warning.
2019-11-16 02:27:24 +01:00
Patryk Obara
2b386fbf52 List files before running linters
Makes it more readable for human consumption. Also, redirect initial
output to stderr to fix e.g. output to json file.
2019-11-16 02:27:24 +01:00
Patryk Obara
8ea7bcf762 Remove -DWIN32 from build.sh 2019-11-14 23:17:54 +01:00
Patryk Obara
1f07886767 Propagate return code in the msys2 bash wrapper
Fixes: #41
2019-11-14 23:17:54 +01:00
Patryk Obara
2bfae63f1f Run fast script linters before heavier analysis
Includes two small scripts: verify-bash.sh for running shellcheck, and
verify-python.sh for running pylint.

.pylint rc files is a default configuration file generated by
pylint 2.3.1, with one change (min-similarity-lines changed
from 4 to 10).
2019-11-14 20:33:36 +01:00
Patryk Obara
e954fe3237 Remove unused bash variable
Reported by shellcheck 0.7.0 (SC2034)
2019-11-14 20:33:36 +01:00
Patryk Obara
6de2e6bd41 Remove unnecessary use of a comprehension
Reported by pylint 2.4.4 (unnecessary-comprehension)
2019-11-14 20:33:36 +01:00
Patryk Obara
3b0a62ad4c Change module documentation to a raw string
Prevents anomalous-backslash-in-string ('\m') pylint warning.
2019-11-14 20:33:36 +01:00
krcroft
f6c137e0b8 Remove SpeexDSP from the CI configuration 2019-11-12 08:17:09 +01:00
Patryk Obara
b7c4a529dc Create a wrapper for MSYS2 bash CI environment
This way there's no need to prepend every line in build job with a path
to MSYS2-installed bash, and deal with problems related to escaping
embedded shell invocations.
2019-11-06 20:40:28 +01:00
krcroft
6d8c9b93b7
Add new dependencies to the workflows and scripts 2019-11-05 17:18:22 -08:00
Patryk Obara
a221b6a040 Update allowed warnings limit
Additionally, fix an obvious typo.
2019-11-02 20:14:43 +01:00
krcroft
85039a6033
Simplify package listing script and standardize workflows
The commit makes the following changes:
 - The package listing script now requires the user specify which package manager
   they're using. This approach resolves the ambiguity if a system has more than
   one package manager (ie: macports & brew)

 - Adds packages for Fedora, RedHat/CentOS, Arch, and OpenSuse

 - Eliminates unecessary code in the package manager script
   (more can be eliminate at the expense of complexity)

 - Made a couple minor fixes to the build script

 - Tried to further "standardize" the workflows as follows:

     - names are Compiler Version (Environment)

     - Sorted them alphabetically in their respective YAMLs

     - Minor spacing adjustment to align values (where it makes sense)

     - Dropped quotes around some of the string values because I'd
       rather our YAML be consistent and propper instead of changing our
       YAML to suite the limitations of an editor (can a different plugin
       or better parser be used?)

     - Added macOS workflows for Homebrew and MacPorts, both ready to
       go and tested, but with the build step just commented out
2019-11-02 07:36:49 -07:00
Patryk Obara
af6557ae70 Update allowed warnings limit 2019-10-29 20:50:23 +01:00
krcroft
86aabad5da
Expand CI coverage and move actions into scripts
This change makes a couple changes to the CI workflow:
 - Adds more compiler coverage:
     - gcc to MacOS (see note below)
     - 32 and 64bit gcc and clang to Windows

 - With more builds, this separates them into per-OS workflow YAMLs
   (laying the foundation for more build environments: BSD? DOS? ... )

 - Moves all functional commands from GitHub-syntax-YAML into scripts,
   which (besides eliminating repeated code), now serve a dual-purpose
   of being runnable outside of GitHub.
     - One script takes care of listing dependent packages for the given
       runtime environment
     - Another script takes care of configuring and building

These scripts can be leveraged by a nightly build & asset generator in
the future.

Note: adding GCC to MacOS is now "correct" from a build perspective,
however to keep this PR focussed on the CI workflow I have not included
the coreMIDI / AppleBlocks code-fixes here (so for now, the gcc macOS
builds will fail; we will merge the coreMIDI / AppleBlocks later
depending on how upstream wants to handle it).
2019-10-28 00:32:16 -07:00
Patryk Obara
52a958270f Log environment on CI machines
log-env.sh is cross-platform (works on Linux, MacOS and Windows)

log-env.ps1 is Windows-only and requirs specifying pwsh shell, but
provides some Windows-specific information, that might be useful e.g.
for MSVC builds.
2019-10-26 00:52:03 +02:00
Patryk Obara
9099f0620e Merge branch 'svn/trunk' 2019-10-20 07:15:43 +02:00
Patryk Obara
1857980f90 Replace an authorsfile with a script
DOSBox maintainer expressed a concern about mail being stored verbatim
in the source code. SourceForge does not forward messages to the
real mailing addresses by default, therefore it's rather pointless to
target them for spamming nowadays, but git-svn can easily take input
from as script, so let's just replace the static file.
2019-10-08 10:56:16 +02:00
Patryk Obara
d4b74d9686 Add alternative for git-log for SVN users
This format makes it easier to correlate SVN revisions with Git commits
for users who depend on such behaviour.

Usual caveats around working with SVN revision numbers apply: they do
not identify patch/commit, they identify a change in the state of whole
SVN repository (i.e. single revision might span multiple paths,
including multiple "branches" or "tags" or "projects").

Do not depend on SVN revisions to uniquely identify a commit created by
an SVN user (especially for scripting) - you need a tuple <SVN path,
SVN revision> for that. It's easier to identify a commit by git hash
(this script displays shortened hash in a first column).
2019-10-08 10:56:16 +02:00
Patryk Obara
f7a5080c22 Update allowed warnings limit 2019-10-04 00:04:13 +02:00
Patryk Obara
f749fe54fa Increase allowed warnings limit
Upstream svn/trunk just introduced a bunch of new warnings.

Piggy-back change to interpret "From:" lines in SVN to be imported as
proper authorship information.
2019-09-30 22:42:47 +02:00
Patryk Obara
9310258c57 Enforce limit on issues found in static analysis
Implements new script (count-bugs.py) for peeking inside clang static
analyzer's report and print just a summary.

If number of detected bugs goes beyond the limit, script will return
with error code 1, thus failing the CI run.  The upper limit is set to
113, which is current result of static analysis in our CI environment
(local run is likely to indicate different number); upper limit will
be updated in time, as issues get fixed or new compiler (detecting more
bugs) will be introduced.

This commit includes also slight modifictaions to count-warnings.py
script, to keep the both scripts outputting in similar format.
2019-09-26 21:30:13 +02:00
Patryk Obara
4c5b4faf2f Set the upper limit on warnings number
This way it will be possible to prevent users from introducing new
warnings. As new fixes will be upstreamed, the maximum limit of
allowed warnings should be taken lower and lower, so this script
could be eventually replaced by -Werror.
2019-09-21 12:14:49 +02:00
Patryk Obara
b47e5aa87f Implement unifdef-all script
This script is useful for improving code readability when researching
code.  Do not commit results of this script.
2019-09-16 06:20:18 +02:00
Patryk Obara
b62a637157 Import svn:ignore props to .gitignore files 2019-09-15 20:34:57 +02:00