Upgrade rust_g to version 0.4.0

This commit is contained in:
Chompstation Bot
2021-07-04 22:47:46 +00:00
parent 0b9ebd3c6a
commit dec034e7a8
6 changed files with 74 additions and 15 deletions

View File

@@ -11,7 +11,7 @@ env:
jobs:
autochangelog:
name: Autochangelog
runs-on: ubuntu-16.04
runs-on: ubuntu-20.04
if: github.event.pull_request.merged == true
steps:
- uses: /actions/checkout@v2

View File

@@ -10,7 +10,7 @@ env:
jobs:
file_tests:
name: Run Linters
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Ensure +x on CI directory
@@ -24,6 +24,7 @@ jobs:
tools/ci/validate_files.sh
tools/ci/build_tgui.sh
<<<<<<< HEAD
# dreamchecker:
# name: DreamChecker
# runs-on: ubuntu-18.04
@@ -51,10 +52,67 @@ jobs:
# if: always()
# with:
# outputFile: output-annotations.txt
||||||| parent of 0d9f538992... Merge pull request #10869 from VOREStation/update-rust_g
dreamchecker:
name: DreamChecker
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Cache SpacemanDMM
uses: actions/cache@v2
with:
path: ~/SpacemanDMM
key: ${{ runner.os }}-dreamchecker-${{ hashFiles('dependencies.sh')}}
restore-keys: ${{ runner.os }}-dreamchecker
- name: Install Dependencies
run: |
tools/ci/install_spaceman_dmm.sh dreamchecker
- name: Run Linter
id: linter
run: |
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
- name: Annotate Linter
uses: yogstation13/DreamAnnotate@v1
if: always()
with:
outputFile: output-annotations.txt
=======
dreamchecker:
name: DreamChecker
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Cache SpacemanDMM
uses: actions/cache@v2
with:
path: ~/SpacemanDMM
key: ${{ runner.os }}-dreamchecker-${{ hashFiles('dependencies.sh')}}
restore-keys: ${{ runner.os }}-dreamchecker
- name: Install Dependencies
run: |
tools/ci/install_spaceman_dmm.sh dreamchecker
- name: Run Linter
id: linter
run: |
~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
- name: Annotate Linter
uses: yogstation13/DreamAnnotate@v1
if: always()
with:
outputFile: output-annotations.txt
>>>>>>> 0d9f538992... Merge pull request #10869 from VOREStation/update-rust_g
unit_tests:
name: Integration Tests
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Ensure +x on CI directory
@@ -69,7 +127,7 @@ jobs:
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install libc6:i386 libgcc1:i386 libstdc++6:i386 libssl1.0.0:i386 zlib1g:i386
sudo apt install zlib1g-dev:i386 libssl-dev:i386 pkg-config:i386
ldd librust_g.so
- name: Unit Tests
run: |

View File

@@ -14,7 +14,7 @@ on:
jobs:
generate_maps:
name: 'Generate NanoMaps'
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Clone
uses: actions/checkout@v2

Binary file not shown.

Binary file not shown.

View File

@@ -20,6 +20,7 @@ THE SOFTWARE.
import argparse, re, sys
from collections import defaultdict
from os import path, walk
from codecs import open
opt = argparse.ArgumentParser()
opt.add_argument('dir', help='The directory to scan for *.dm files with non-matching spans')
@@ -54,13 +55,13 @@ def get_tag_matches(line):
# Support def that simply checks if a given dictionary in the format tag/list of unmatched lines has mismatch entries.
def has_mismatch(match_list):
for tag, list_of_mismatched_lines in match_list.iteritems():
for tag, list_of_mismatched_lines in match_list.items():
if(len(list_of_mismatched_lines) > 0):
return 1
return 0
def arrange_mismatches(mismatches_by_tag, mismatch_line, mismatch_counts):
for tag, mismatch_count in mismatch_counts.iteritems():
for tag, mismatch_count in mismatch_counts.items():
stack_of_existing_mismatches = mismatches_by_tag[tag]
for i in range(0, abs(mismatch_count)):
if len(stack_of_existing_mismatches) == 0:
@@ -86,7 +87,7 @@ for root, subdirs, files in walk(args.dir):
for filename in files:
if filename.endswith('.dm'):
file_path = path.join(root, filename)
with open(file_path, 'r') as file:
with open(file_path, 'r', encoding='utf-8', errors='ignore') as file:
mismatches_by_file[file_path] = defaultdict(list)
for line_number, line in enumerate(file, 1):
# Then for each line in the file, conduct the tuple open/close matching.
@@ -97,10 +98,10 @@ for root, subdirs, files in walk(args.dir):
# Loops over all matches and checks if there is a mismatch of tags.
# If so, then and only then is the corresponding file path printed along with the number of unmatched open/close tags.
total_mismatches = 0
for file, mismatches_by_tag in mismatches_by_file.iteritems():
for file, mismatches_by_tag in mismatches_by_file.items():
if has_mismatch(mismatches_by_tag):
print(file)
for tag, mismatch_list in mismatches_by_tag.iteritems():
for tag, mismatch_list in mismatches_by_tag.items():
# A positive number means an excess of opening tag, a negative number means an excess of closing tags.
total_mismatches += len(mismatch_list)
if len(mismatch_list) > 0: