https://github.com/darmiel/fff-ir-lint
FlipperFormat .ir Lint | Detect common mistakes in .ir files
https://github.com/darmiel/fff-ir-lint
flipper flipper-zero flipperzero hacktoberfest
Last synced: 11 days ago
JSON representation
FlipperFormat .ir Lint | Detect common mistakes in .ir files
- Host: GitHub
- URL: https://github.com/darmiel/fff-ir-lint
- Owner: darmiel
- Created: 2022-09-16T11:11:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-21T20:21:26.000Z (over 1 year ago)
- Last Synced: 2024-05-01T14:13:48.485Z (12 months ago)
- Topics: flipper, flipper-zero, flipperzero, hacktoberfest
- Language: Python
- Homepage:
- Size: 458 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# fff-ir-lint
Finds common mistakes in `.ir` files ([FlipperFormat](https://github.com/Eng1n33r/flipperzero-firmware/tree/dev/lib/flipper_format)).
**DOES NOT AUTOMATICALLY FIX ANY ERRORS**
## Usage
```shell
$ python3 main.py [file 1] [file 2] ... [file n]
$ python3 main.py 'glob:**/*.ir'
```> **Note**: You can use glob-pattern by prefixing `glob:`
## Formats
### GitHub
> Specify `github` or `github2` *(newer)* for format

### Simple
> Specify `simple` for format
```
→ python3 main.py simple remote.ir
*********************************
[lint] checking 'remote.ir' [1/1]
Error in line 19
'protocol:NEC'
↑
[error]: space missing after ':'
[suggested] 'protocol: NEC'
---
Error in line 19
'protocol:NEC'
↑↑↑↑↑↑↑↑
[error]: key 'type' expected
[suggested] 'type: ...'
---
[lint] found 2 warnings/errors in file.
*********************************
```## CI/CD
An example GitHub Actions Workflow can be found [here](./examples/gh_actions_pr_lint_review.yaml).
The linter should work in a CI/CD pipeline.
Just put the example in your repo under the `.github/workflows` directory and
[enable](https://docs.github.com/en/actions/managing-workflow-runs/disabling-and-enabling-a-workflow)
actions in the repo if necessary.If a pull request is created in which `.ir` files are modified, the linter checks the modified (or newly created) `.ir` files.
If errors are found, they are appended as a comment to the PR and the PR is set to **Requested Changes**.