Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Divy1211 committed Sep 19, 2024
1 parent c31d076 commit 3a6a4a7
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,46 @@ cargo install --git https://github.com/Divy1211/xs-check

This is recommended, as it will automatically add the binary to your system's path variable.

## Usage

Suppose you have an XS file like so:

`test.xs`
```cpp
void test(float f = 0.0) {
int cp = xsGetContextPlayer();
xsChatData("cp: %d", cp);
}

void test(float f = 0.0) {
int b = "Oops";
}

void main() {
test(1);

float c = 4 + 5.5;
}
```
Invoke the binary on the file:
```sh
xs-check ./test.xs
```

And it will generate an output with all the errors it finds:

![test.png](./imgs/test.png)

You may also tell it to ignore warnings (errors cannot be ignored) with a comma separated list:

```sh
xs-check file.xs --ignores warning1,warning2
```

The name used to ignore the warning is the same name that is printed in the first line of the warning. Ignoring the `DiscardedFn` warning may be useful at times

## Cool Maths

Note: GitHub does not render all the latex correctly, read these docs here: https://divy1211.github.io/xs-check/
Expand Down
Binary file added imgs/test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion test_xs/test.xs
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
void test() {
void test(float f = 0.0) {
int cp = xsGetContextPlayer();
xsChatData("cp: %d", cp);
}

void test(float f = 0.0) {
int b = "Oops";
}

void main() {
test(1);

float c = 4 + 5.5;
}

0 comments on commit 3a6a4a7

Please sign in to comment.