Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 973-add-support-for…
Browse files Browse the repository at this point in the history
…-inline-declared-variables
  • Loading branch information
ghaith committed Feb 23, 2024
2 parents a13aeca + f58a57f commit b9a62a7
Show file tree
Hide file tree
Showing 806 changed files with 28,816 additions and 18,512 deletions.
6 changes: 5 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ rustflags = [
"-C",
"link-arg=--target=aarch64-linux-gnu",
]
linker = "clang"
linker = "clang"

[profile.profiling]
inherits = "release"
debug = true
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ENV DEBIAN_FRONTEND=noninteractive
# # [Optional] Add sudo support for the non-root user
# && apt-get install -y sudo \
# && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
# && chmod 0440 /etc/sudoers.d/$USERNAME
# && chmod 0440 /etc/sudoers.d/$USERNAME

RUN apt-get -y update
RUN apt-get -y install git
Expand Down
71 changes: 36 additions & 35 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
{
"name": "Rust",
"build": {
"dockerfile": "./Dockerfile"
},
// "image": "ghcr.io/plc-lang/rust-llvm:latest",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"name": "Rust",
"build": {
"dockerfile": "./Dockerfile"
},
// "image": "ghcr.io/plc-lang/rust-llvm:latest",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
}
},
// Set *default* container specific settings.json values on container create.
"customizations": {
"vscode": {
"settings": {
"lldb.executable": "/usr/bin/lldb",
// VS Code don't watch files under ./target
"files.watcherExclude": {
"**/target/**": true
},
"rust-analyzer.checkOnSave.command": "clippy"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"bungcip.better-toml",
"vadimcn.vscode-lldb",
"mutantdino.resourcemonitor",
"rust-lang.rust-analyzer"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "rustc --version",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"containerUser": "vscode"
},
// Set *default* container specific settings.json values on container create.
"customizations": {
"vscode": {
"settings": {
"lldb.executable": "/usr/bin/lldb",
// VS Code don't watch files under ./target
"files.watcherExclude": {
"**/target/**": true
},
"rust-analyzer.checkOnSave.command": "clippy"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"bungcip.better-toml",
"editorconfig.editorconfig",
"vadimcn.vscode-lldb",
"mutantdino.resourcemonitor",
"rust-lang.rust-analyzer"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "rustc --version",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"containerUser": "vscode"
}
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.{yaml,yml}]
indent_size = 2
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Set default behaviour to force line endings to LF.
* text=auto eol=lf
2 changes: 0 additions & 2 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Run Documentation Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Update git permissions
run: |
git config --global --add safe.directory /__w/rusty/rusty
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ on:
workflow_dispatch:

jobs:
check:
check:
name: Check
runs-on: ubuntu-latest
container: ghcr.io/plc-lang/rust-llvm:latest
steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Run Check
run: |
Expand Down Expand Up @@ -49,12 +47,17 @@ jobs:
echo "Build command : ./scripts/build.sh --build --release"
./scripts/build.sh --build --release --package \
--target x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu
- uses: actions/upload-artifact@master
with:
name: plc
path: target/release/plc

- uses: actions/upload-artifact@master
with:
name: schema
path: compiler/plc_project/schema

- uses: actions/upload-artifact@master
with:
name: stdlib
Expand All @@ -80,7 +83,7 @@ jobs:
with:
version: ${{ env.llvm-version }}
directory: "./llvm"

- name: Cargo test (Unit)
uses: actions-rs/cargo@v1
with:
Expand All @@ -104,7 +107,7 @@ jobs:
with:
command: build
args: --release

- uses: actions/upload-artifact@master
with:
name: plc.exe
Expand All @@ -122,7 +125,7 @@ jobs:
./scripts/build.sh --check-style
coverage:
name: Run Coverage
name: Run Coverage
runs-on: ubuntu-latest
container: ghcr.io/plc-lang/rust-llvm:latest
steps:
Expand All @@ -135,7 +138,7 @@ jobs:
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
files: lcov.info
files: lcov.info

- name: Archive code coverage results
uses: actions/upload-artifact@v1
Expand Down
75 changes: 75 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Pre-commit is currently in testing phase for this repo. It is not yet forced
# in CI or mandatory to use. Pre-commit will run various checks and mostly fix
# those when you do commiting. You can use it locally by installing it with
#
# pip install pre-commit
#
# and running
#
# pre-commit install
#
# in the root of the repository. This will install git hook which will run
# checks before every commit. If you want to run checks manually for whole repo,
# you can run
#
# pre-commit run --all-files
#
# You can always commit without running checks by adding --no-verify flag to git
# commit command.

exclude: target/|\.git/|.*\.snap

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: c4a0b883114b00d8d76b479c820ce7950211c99b # v4.5.0
hooks:
- id: check-merge-conflict
args: [--assume-in-merge]
# Editorconfig-checker does not care if file contains multiple newlines.
- id: end-of-file-fixer
- id: check-yaml
- id: check-case-conflict
- id: trailing-whitespace
- id: fix-byte-order-marker

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: 762c66ea96843b54b936fc680162ea67f85ec2d7 # v1.5.4
hooks:
- id: remove-tabs
name: Remove tabs (4 spaces)
args: ['--whitespaces-count', '4']
exclude: \.(yaml|yml)$
- id: remove-tabs
name: Remove tabs (2 spaces)
args: ['--whitespaces-count', '2']
files: \.(yaml|yml)$

- repo: https://github.com/pre-commit/pygrep-hooks
rev: 3a6eb0fadf60b3cccfd80bad9dbb6fae7e47b316 # v1.10.0
hooks:
- id: text-unicode-replacement-char
exclude: ".*test_fdx_utf8.cpp$"

# Formatting Python code. We have not so many files so no example flake8 yet.
- repo: https://github.com/psf/black
rev: 2a1c67e0b2f81df602ec1f6e7aeb030b9709dc7c #23.11.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/doublify/pre-commit-rust
rev: eeee35a89e69d5772bdee97db1a6a898467b686e #v1.0
hooks:
- id: fmt
- id: cargo-check
- id: clippy
args: ["--", "-D", "warnings"]

- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2b74735540f79457a50369e5c17a2c35d52c3298 # 2.7.3
hooks:
- id: editorconfig-checker
args: [
# Saddly we have to disable this, but it just won't work. Maybe some day.
-disable-indent-size,
]
6 changes: 4 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
}
},
"args": [
"target/demo.st"
"--check",
"target/demo.st",
"-i","libs/stdlib/iec61131-st/timers.st"
],
"cwd": "${workspaceFolder}"
},
Expand All @@ -46,4 +48,4 @@
"cwd": "${workspaceFolder}"
},
]
}
}
Loading

0 comments on commit b9a62a7

Please sign in to comment.