Skip to content

feat: inject code before and after leetcode boilerplate #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
docs: Update README.md for inject_before and inject_after
  • Loading branch information
Subjective committed Sep 8, 2023
commit 666a1c965c417570898e5336a402bce3cc5ce167
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ SUBCOMMANDS:

## Example

For example, given this config (could be found at `~/.leetcode/leetcode.toml`):
To configure leetcode-cli, create a file at `~/.leetcode/leetcode.toml`):

```toml
[code]
Expand Down Expand Up @@ -186,6 +186,14 @@ pub fn three_sum(nums: Vec<i32>) -> Vec<Vec<i32>> {

<br>

Some linting tools/lsps will throw errors unless the necessary libraries are imported. leetcode-cli can generate this boilerplate automatically if the `inject_before` key is set. Similarly, if you want to test out your code locally, you can automate that with `inject_after`. For c++ this might look something like:

```toml
[code]
inject_before = ["#include<bits/stdc++.h", "using namespace std;"]
inject_after = ["int main() {\n Solution solution;\n\n}"]
```

#### 1. <kbd>pick</kbd>

```sh
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy