Skip to content

Commit b5f7060

Browse files
committed
Initial commit
0 parents  commit b5f7060

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3060
-0
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = tab
6+
indent_size = 4
7+
insert_final_newline = true
8+
end_of_line = lf
9+
10+
[*.{yml,yaml,ksy}]
11+
indent_style = space
12+
indent_size = 2

.github/.templateMarker

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
KOLANICH/python_project_boilerplate.py

.github/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
allow:
8+
- dependency-type: "all"

.github/workflows/CI.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [ "master" ]
5+
pull_request:
6+
branches: [ "master" ]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- name: typical python workflow
13+
uses: KOLANICH-GHActions/typical-python-workflow@master
14+
with:
15+
github_token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
__pycache__
2+
*.pyc
3+
*.pyo
4+
/Synalysis2Kaitai.egg-info
5+
/build
6+
/dist
7+
/.eggs
8+
/grammars
9+
/results
10+
/OK
11+
/testedFormatsInstances

.gitlab-ci.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
image: registry.gitlab.com/kolanich/fixed_python:latest
2+
3+
stages:
4+
- dependencies
5+
- build
6+
- test
7+
- tooling
8+
9+
build:
10+
tags:
11+
- shared
12+
stage: build
13+
variables:
14+
GIT_DEPTH: "1"
15+
PYTHONUSERBASE: ${CI_PROJECT_DIR}/python_user_packages
16+
SYNALYSIS_REPO: https://github.com/synalysis/Grammars.git
17+
18+
before_script:
19+
- export PATH="$PATH:$PYTHONUSERBASE/bin" # don't move into `variables`
20+
#- . ./scripts/setup.sh
21+
22+
cache:
23+
paths:
24+
- $PYTHONUSERBASE
25+
26+
script:
27+
- python3 setup.py bdist_wheel
28+
- mkdir wheels
29+
- mv ./dist/*.whl ./wheels/synalisys2kaitai-0.CI-py3-none-any.whl
30+
- pip3 install --user --upgrade ./wheels/synalisys2kaitai-0.CI-py3-none-any.whl
31+
#- ./scripts/test.sh
32+
#- coverage run -a --source=Endianness ./tests/tests.py
33+
#- coverage report -m || true
34+
#- coveralls || true
35+
#- codecov || true
36+
artifacts:
37+
paths:
38+
- wheels
39+
40+
checks:
41+
stage: tooling
42+
tags:
43+
- shared
44+
image: docker:latest
45+
variables:
46+
DOCKER_DRIVER: overlay2
47+
allow_failure: true
48+
services:
49+
- docker:dind
50+
script:
51+
- docker run --env SAST_CONFIDENCE_LEVEL=5 --volume "$PWD:/code" --volume /var/run/docker.sock:/var/run/docker.sock "registry.gitlab.com/gitlab-org/security-products/sast:latest" /app/bin/run /code
52+
- docker run --env SOURCE_CODE="$PWD" --env CODECLIMATE_VERSION="latest" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock "registry.gitlab.com/gitlab-org/security-products/codequality:latest" /code
53+
#- docker run --env DEP_SCAN_DISABLE_REMOTE_CHECKS="${DEP_SCAN_DISABLE_REMOTE_CHECKS:-false}" --volume "$PWD:/code" --volume /var/run/docker.sock:/var/run/docker.sock "registry.gitlab.com/gitlab-org/security-products/dependency-scanning:latest" /code
54+
55+
artifacts:
56+
reports:
57+
codequality: gl-code-quality-report.json
58+
sast: gl-sast-report.json
59+
#dependency_scanning: gl-dependency-scanning-report.json

Code_Of_Conduct.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
No codes of conduct!

ReadMe.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Synalysis to Kaitai Struct grammar converter
2+
============================================
3+
[![Code style: antiflash](https://img.shields.io/badge/code%20style-antiflash-FFF.svg)](https://github.com/KOLANICH-tools/antiflash.py)
4+
5+
6+
It's a Work In Progress repo where I store my drafts on implementing https://github.com/kaitai-io/kaitai_struct/issues/383 . For testing it needs some definitions in a working dir, you can get them on https://github.com/synalysis/Grammars/ .
7+
8+
The doc which may be useful for understanding grammars format is by the link:
9+
10+
Testing workflow
11+
----------------
12+
1. Clone this repo.
13+
2. Go to the working dir (this repo dir assummed).
14+
3. `./scripts/setup.sh`. This will clone the formats repo into a subdir and put differrent sorts of files into subdirs.
15+
4. `./scripts/test.sh` This will try to cmpile the remaining files into KS definitions. Then check the definitions and grammars manually and verify that they correspond to each other. Then add their file names without the last extension into the corresponding file in the lists directory.
16+
17+
Lists description
18+
-----------------
19+
20+
* `not_ok` - it seems there is an error in the definition itself.
21+
* `OK` - compiled into a `ksy` without errors
22+
* `checked_OK` - manual comparison of the `.ksy` and the `.grammar` files showed that it seems that they specify the same grammar (with respect to the tool limitations) AND ksy compiles into python AND python module is IMPORTED succesfully.
23+
* `checked_OK_after_fixes` - error in the definition was manually fixed, after that the same as `checked_OK`.
24+
* `tested_OK` - the resulting `ksy` was tested on actial files

0 commit comments

Comments
 (0)