Skip to content

Commit

Permalink
docs: update lint script examples and usage details ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Nov 22, 2024
1 parent 5ce936f commit 283f9d7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docs/src/content/docs/samples/lint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ keywords: ["genai", "linter", "script", "coding", "best practices"]
sidebar:
order: 2
---

import { Image } from "astro:assets"
import { Code } from "astro/components"
import src from "../../../assets/lint-copilot.png"
import alt from "../../../assets/lint-copilot.png.txt?raw"
import code from "../../../../../packages/sample/genaisrc/lint.genai.mjs?raw"

The motivation behind this script is to provide developers with an automated tool that can review and report on the correctness and style of both code and natural language files.
It leverages the power of LLM to inspect code or documents in new ways.
It leverages the power of LLM to inspect code or documents in new ways.

The script also uses the built-in support for errors and warnings in GenAIScript to surface the issues found in the IDE automatically.

<Image src={src} alt={alt} loading="lazy" />


### Script Breakdown

Below is a step-by-step explanation of the script:
Expand Down Expand Up @@ -83,12 +83,16 @@ def("FILE", env.files, { lineNumbers: true })
To execute this script, you can run it from Visual Studio Code or use the GenAIScript CLI. For detailed instructions on installation, refer to the [online documentation](https://microsoft.github.io/genaiscript/getting-started).

```bash
npx --yes genaiscript run lint
npx --yes genaiscript run lint <file1> <file2> ...
```

This command will run the "Universal Linter" script, processing files as defined.

By following the steps outlined above, you can leverage the power of GenAI to automate the linting process for your projects, ensuring high standards in your code and document files. Happy linting! 🎉
From the GitHub Copilot Chat window, you can run the linter on all the files in the context by running:

```sh
@genaiscript /run lint
```

## Full Source

Expand Down

0 comments on commit 283f9d7

Please sign in to comment.