Skip to main content

.ir Linter for FFF

Project description

Header-Dark Header-Light

fff-ir-lint

Finds common mistakes in .ir files (FlipperFormat).

DOES NOT AUTOMATICALLY FIX ANY ERRORS

Usage

$ python3 main.py <format> [file 1] [file 2] ... [file n]
$ python3 main.py <format> 'glob:**/*.ir'

Note: You can use glob-pattern by prefixing glob:

Formats

GitHub

Specify github or github2 (newer) for format

GitHub-Dark GitHub-Light

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.

The linter should work in a CI/CD pipeline. Just put the example in your repo under the .github/workflows directory and enable 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fff_ir_lint-0.0.1.tar.gz (492.5 kB view hashes)

Uploaded Source

Built Distribution

fff_ir_lint-0.0.1-py3-none-any.whl (10.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page