Skip to content
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

Update Main #68

Merged
merged 214 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
214 commits
Select commit Hold shift + click to select a range
e297e89
Add README and .gitignore files
nassersaazi Jun 10, 2023
423407a
Merge pull request #11 from nassersaazi/develop
c-git Jun 11, 2023
fedf83a
Move code into lib
c-git Jun 10, 2023
65f8228
Put dependencies in lexicographical order
c-git Jun 10, 2023
45d869f
Remove white space
c-git Jun 10, 2023
1c0e7c2
Set specific serde version
c-git Jun 11, 2023
d69d5a4
Change return type to anyhow::Result
c-git Jun 11, 2023
0152387
Add clap
c-git Jun 11, 2023
1d735ed
Restructure to put executed code into lib
c-git Jun 11, 2023
2fc4eac
Add basic logging support
c-git Jun 11, 2023
822d57e
Change version of log to stop warning
c-git Jun 11, 2023
09c62a4
Add description
c-git Jun 11, 2023
25524cf
Improve logging and error messages
c-git Jun 11, 2023
d8f72de
Add check to ensure correct folder
c-git Jun 11, 2023
bbe56ec
Change return types to anyhow
c-git Jun 11, 2023
3cb91b7
Connect up existing code
c-git Jun 11, 2023
0edfaef
Move leetcode url into config
c-git Jun 11, 2023
24b77ac
Remove parts of paths that look like they should change
c-git Jun 11, 2023
9bc6e1e
Move GraphQL link into config
c-git Jun 11, 2023
ddc9af7
Add TODOs to document what needs to be done
c-git Jun 11, 2023
64746e5
Convert from url to slug
c-git Jun 11, 2023
26a0370
Add where logs come from
c-git Jun 11, 2023
1260810
Change all log messages to info
c-git Jun 11, 2023
8fa8680
Fix path missed
c-git Jun 11, 2023
9c64407
Add logging to functions
c-git Jun 11, 2023
9b085d7
Enable writing out files
c-git Jun 11, 2023
a3b5826
Add install instructions to readme
c-git Jun 11, 2023
385ab3b
Update CLI to work with cargo properly
c-git Jun 11, 2023
84c56dc
Update test
c-git Jun 11, 2023
30d3ebf
Add screenshots
c-git Jun 11, 2023
fca7be3
Remove completed todo
c-git Jun 11, 2023
8d19c1d
Add license
c-git Jun 11, 2023
4bfd0f0
Add more package metadata
c-git Jun 11, 2023
d503a5d
Simplify arguments
c-git Jun 12, 2023
2821d63
Pull out log4rs
c-git Jun 12, 2023
d45e334
Cargo deny init
c-git Jun 12, 2023
9f09676
Prevent licenses from causing CI to fail
c-git Jun 12, 2023
848ab7a
Plug in replacement logger
c-git Jun 12, 2023
2f81d11
Change return types to result
c-git Jun 12, 2023
d8d8227
Restructure to match command line subcommands
c-git Jun 12, 2023
ea1ea23
Add context for errors
c-git Jun 13, 2023
67fcb9f
Move check for url into function
c-git Jun 13, 2023
112d63d
Add context
c-git Jun 13, 2023
48cc562
Tweak output code to be easier to copy
c-git Jun 13, 2023
4ed136c
Invert `is_design` to make it correct
c-git Jun 13, 2023
0e42ef2
Simplify argument passing for generate
c-git Jun 13, 2023
60fae39
Add new cli option to have number included
c-git Jun 13, 2023
446873c
Restructure code in for new functionality
c-git Jun 14, 2023
49408c8
Forbid Unsafe
c-git Jun 14, 2023
09b3815
Create module for problem metadata
c-git Jun 14, 2023
8ef9d1e
Remove URL literal missed earlier
c-git Jun 14, 2023
add2b4f
Change unimplemented to todo
c-git Jun 14, 2023
ea9dd67
Implement retrieval of metadata
c-git Jun 14, 2023
61e5fc6
Move Problem Code into custom struct
c-git Jun 14, 2023
94e78fa
Invert check as design means the opposite
c-git Jun 14, 2023
dc394f9
Add output on successful run
c-git Jun 14, 2023
4561ac0
Stub out main functionality for test cases
c-git Jun 14, 2023
136d16a
Disable rustfmt for testing
c-git Jun 14, 2023
18dbc96
Implement get_fn_info
c-git Jun 15, 2023
3196d08
Implement new for FunctionArgs
c-git Jun 15, 2023
818cbf4
Implement get_test_case
c-git Jun 15, 2023
00825c9
Implement get_args_with_case
c-git Jun 15, 2023
ba4071b
Clear lints for function and replace with TODO
c-git Jun 15, 2023
e3d981c
Implement get_args_names
c-git Jun 15, 2023
e966050
Add argument for expected value
c-git Jun 15, 2023
e73e145
Fix up white spaces generated
c-git Jun 15, 2023
8b1915c
Enable rustfmt
c-git Jun 15, 2023
6afa5a3
Change wording to be more clear
c-git Jun 15, 2023
03dbc93
Update generate screenshot
c-git Jun 15, 2023
a6d1dac
Update regex to not select line in comments
c-git Jun 15, 2023
1e40870
Change method of checking for design problem
c-git Jun 15, 2023
201fa4d
Add support for tree and list questions
c-git Jun 15, 2023
d0205ca
Refactor to better model domain
c-git Jun 15, 2023
eb6c6dc
Remove unneeded log messages
c-git Jun 15, 2023
157f9f6
List currently only implemented for vec
c-git Jun 15, 2023
646a80f
Add problem number and title to the code output
c-git Jun 16, 2023
2f24ef8
Add feature flags
c-git Jun 16, 2023
ccfca01
Use implicit features because of old rust on leetcode
c-git Jun 16, 2023
b4ce96a
Remove comments and unmodified settings
c-git Jun 19, 2023
b7e13f3
Clarify documentation
c-git Jun 19, 2023
5cbef9a
Add alias for generate and short
c-git Jun 20, 2023
5f760ea
Turn on auto save
c-git Jun 20, 2023
12c637a
Added link to default template
c-git Jun 20, 2023
d4482a7
Add context for better error messages on invalid input
c-git Jun 20, 2023
7e2b733
Merge pull request #15 from rust-practice/code_restructure
c-git Jun 20, 2023
242dec4
Document current reasoning
c-git Jun 21, 2023
b1d4575
Make it easier to install when testing
c-git Jun 21, 2023
b381b94
Add support for i64 and any other arbitrary type
c-git Jun 21, 2023
13f0c70
Add warnings instead of failing on parse error
c-git Jun 21, 2023
f06a3b4
Remove prefix from enum names
c-git Jun 22, 2023
3281c45
Add support for `bool` and `Vec<bool>`
c-git Jun 22, 2023
8f68e5b
Update screenshot for readme
c-git Jun 24, 2023
89fedf0
Reword to make more clear
c-git Jun 24, 2023
ccd7153
Add instructions to add library support
c-git Jun 24, 2023
0671adf
Make solution public to avoid unused function lints.
sak96 Jun 26, 2023
70f07b0
Merge pull request #30 from rust-practice/type_support
c-git Jun 26, 2023
70f89d5
Merge branch 'develop' into feat/pub_solution
c-git Jun 26, 2023
ac60729
Merge pull request #31 from rust-practice/feat/pub_solution
sak96 Jun 26, 2023
1f09132
Fix typo
c-git Jun 28, 2023
62befd2
Add F64 and VecF64
c-git Jun 28, 2023
77b1311
Record intent to add support
c-git Jun 28, 2023
c06fb0e
Implement approximately equal to 5dp for f64
c-git Jun 28, 2023
ff31597
Merge pull request #32 from rust-practice/F64_Support
c-git Jun 28, 2023
75c5132
Merge binary and library and change default feature.
sak96 Jun 28, 2023
aa42c63
Merge pull request #35 from rust-practice/feat/merge_binary_lib
sak96 Jun 28, 2023
0372f88
Enable all features for rust-analyzer in vscode
c-git Jun 28, 2023
5f812cf
Add separator between code and tests
c-git Jun 28, 2023
c3455e2
Decrease default logging level to warn
c-git Jun 28, 2023
b85386a
Add instructions to run direct from source code
c-git Jun 28, 2023
a453e35
Replace for loop with function from std
c-git Jun 28, 2023
d2e0ab2
Link run from code back to help
c-git Jun 28, 2023
c078745
Reduce log level to warn to better match severity
c-git Jun 29, 2023
d631be4
Add support for Vec<String>
c-git Jun 29, 2023
9bb2ea4
Add todo!() to empty function body
c-git Jun 29, 2023
eea1ee1
Improve error message
c-git Jun 29, 2023
e192e1d
Enable path as global option
c-git Jun 29, 2023
b06b15d
Add instructions on use of path and change g to lg
c-git Jun 29, 2023
e1b73ef
Merge pull request #36 from rust-practice/small_task
c-git Jun 29, 2023
f882da0
Correct comment
c-git Jun 29, 2023
279a12f
Add warnings for undocumented items
c-git Jun 29, 2023
cccfd10
Ensure all types added to leetcode impl debug
c-git Jun 29, 2023
0196331
Add warning to prevent accidentally confusing code
c-git Jun 29, 2023
d857ad0
Clean up what showed as pub
c-git Jun 29, 2023
d82e1ef
Add way to wrap doc strings
c-git Jun 30, 2023
47d7ba9
Top level documentation
c-git Jun 30, 2023
1202a02
Update comment based on new info
c-git Jun 30, 2023
c912fb3
Add program name to top level heading
c-git Jun 30, 2023
4be9f35
Apply rustfmt comments wrapping
c-git Jun 30, 2023
f74abdb
Removed lint because it is unstable
c-git Jun 30, 2023
a49aa5e
Document public items
c-git Jun 30, 2023
66a18f9
Change to debug_assert
c-git Jun 30, 2023
bef4c1c
Remove outdated comment
c-git Jun 30, 2023
9bf33f7
Remove unused code
c-git Jun 30, 2023
218af69
Add TODOs for tests to be added
c-git Jun 30, 2023
0bcfde1
Test vec to linked list
c-git Jun 30, 2023
66a6ac4
Test linked list to vec
c-git Jun 30, 2023
0603411
Test tree to vec
c-git Jun 30, 2023
7c990a9
Add pretty assertions
c-git Jun 30, 2023
4c2338c
Trim trailing white space
c-git Jun 30, 2023
6738e47
Test from str to tree
c-git Jun 30, 2023
d6bb059
Partially completed test
c-git Jun 30, 2023
f9742b5
Set feature to be used during testing in CI
c-git Jun 30, 2023
4fb8969
Remove pretty_assertions, too much work to remember to use it
c-git Jun 30, 2023
348d2c3
Configure VSCode Plugin to test
c-git Jun 30, 2023
ce47862
Allow "." to match new line
c-git Jul 1, 2023
d691ac4
Allow Uppercase Letters and require identifier
c-git Jul 1, 2023
f0e1b9c
Test argument type parsing
c-git Jul 1, 2023
df0ad69
Test has_tree
c-git Jul 1, 2023
ef464b5
Test has_list
c-git Jul 1, 2023
b67df44
Confirm return type is none
c-git Jul 1, 2023
7c3ed74
Test get_args_with_case
c-git Jul 1, 2023
14d0166
Change Implementation to use replace
c-git Jul 1, 2023
67fb205
Test get_args_names
c-git Jul 1, 2023
a4182d1
Refactor common code out
c-git Jul 1, 2023
cb77670
Update src/lib.rs
nassersaazi Jul 4, 2023
1eaf53f
Apply suggestions from code review
nassersaazi Jul 4, 2023
3b6cdc1
Update src/lib.rs
nassersaazi Jul 4, 2023
ce3b580
Removed TODO item
c-git Jul 5, 2023
24639c0
Test slug/url detection and extraction
c-git Jul 5, 2023
f4857c4
Ensure URLs end in "/"
c-git Jul 5, 2023
cc88ad4
Test conversion of test cases to case string
c-git Jul 12, 2023
d3e574d
Remove plan to do test
c-git Jul 12, 2023
d9c4771
Make logging a global option
c-git Jul 12, 2023
8d906ff
Move logging in "normal" path to debug
c-git Jul 12, 2023
2ced582
Add comments to make code easier to follow
c-git Jul 12, 2023
b34eb43
Add more debug info at debug log level
c-git Jul 12, 2023
778fc1d
Update link to file issue
c-git Jul 12, 2023
f87a986
Add TODO for intended fix / workaround
c-git Jul 12, 2023
cdf7c17
Add custom bug report types
c-git Jul 12, 2023
67ba107
Wrap unknown input type in TODO
c-git Jul 12, 2023
e7cc139
Wrap unexpected input types in todo!()
c-git Jul 13, 2023
dbafdd2
Remove TODO
c-git Jul 13, 2023
66ef1b0
Add template to link
c-git Jul 19, 2023
42d05dc
Merge pull request #38 from rust-practice/documentation_and_testing
c-git Jul 19, 2023
97ec9e7
Merge branch 'develop' into Tests
c-git Jul 19, 2023
6541c0e
Merge pull request #39 from rust-practice/Tests
c-git Jul 19, 2023
b6e6a95
Merge branch 'develop' into BugFix
c-git Jul 19, 2023
c0d24ac
Merge pull request #41 from rust-practice/BugFix
c-git Jul 19, 2023
61ce218
Override cargo test to test all features
c-git Jul 21, 2023
ea7bdf6
Merge cases for vecs
c-git Jul 21, 2023
8f67ef9
Reorder cases by complexity
c-git Jul 21, 2023
593dfd0
Move test to end to make it easier to find
c-git Jul 21, 2023
e5c623f
This should not have been commented out
c-git Jul 21, 2023
1195cb6
Test outputs from apply
c-git Jul 22, 2023
9700676
Merge Vec cases
c-git Jul 22, 2023
a308076
Group similar types
c-git Jul 22, 2023
bfa74b8
Add VecVecString
c-git Jul 22, 2023
8c0f33a
Set CI to test all features
c-git Jul 22, 2023
b89ddae
Merge pull request #48 from rust-practice/support_vec_vec_string
c-git Jul 22, 2023
eff2cb5
Stop unused import when compiling in release mode
c-git Jul 25, 2023
e0a627f
Add PartialEq to release builds
c-git Jul 25, 2023
7bc18b2
Test new workflow for release compilation
c-git Jul 25, 2023
664c838
Switch to only run on main
c-git Jul 25, 2023
179e2cf
Merge pull request #53 from rust-practice/release_compile_fix
c-git Jul 25, 2023
4970d62
Add contribution guide
nassersaazi Jul 27, 2023
101b9e2
Wrap long lines using rustfmt with nightly
c-git Sep 3, 2023
7692b7f
Remove unneeded comment
c-git Sep 3, 2023
c540a24
Fix typo
c-git Sep 3, 2023
4e7ee15
Replace this to improve readability
c-git Sep 3, 2023
885d92a
Make updates to contribution guide in preparation for publishing
c-git Jan 11, 2024
e22474f
Ask contributors to use develop instead of main
c-git Jan 11, 2024
b796e79
Remove cargo check as it's just duplicated work
c-git Jan 11, 2024
707c623
use dprint to format files
c-git Jan 11, 2024
e26155f
Remove misleading line as it doesn't actually work
c-git Jan 11, 2024
9166c37
FIx lints from new version of rust
c-git Jan 11, 2024
3a0cf3f
Merge branch 'develop' into contribution-guide
c-git Jan 12, 2024
8f4853a
Clarify statement in readme
c-git Jan 13, 2024
239ed45
Merge pull request #55 from nassersaazi/contribution-guide
c-git Jan 22, 2024
6775ba5
Update CONTRIBUTING.md
c-git Jan 22, 2024
eb49761
Merge pull request #67 from rust-practice/c-git-fix-typo-in-contribut…
c-git Jan 22, 2024
ca43b30
Allow spaces after function name
c-git Jan 24, 2024
ac7ec63
Add TODO to change how constant is validated
c-git Jan 24, 2024
4257a47
Version Bump
c-git Jan 24, 2024
20adebd
Increasing version number given the number of changes
c-git Jan 24, 2024
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
4 changes: 4 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[alias]
i = "install --path . --features=tool"
g = "run --features=tool -- leet gen"
t = "test --all-features"
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''

---

**Describe the bug**

<!-- A clear and concise description of what the bug is. -->

**Leetcode problem**

<!-- Link to example problem on leetcode where the bug manifests if applicable. If not just put N/A -->

**To Reproduce**

<!-- Steps / command to reproduce the behavior. Example `cargo leet gen https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/`-->

``

**Error Message**

<!-- If applicable please provide a copy of the error received or a screenshot of the error -->

```
```

**Expected behavior**

<!-- A clear and concise description of what you expected to happen. Not necessary if error was received. -->

**Environment Info:**

<!-- Use `cargo version` at command line to get version of cargo. e.g. "cargo 1.70.0 (ec8a8a0ca 2023-04-25)" -->

- Cargo Version:

**Additional context**

<!-- Add any other context about the problem here. -->
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/missing_type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Missing Type
about: Report the missing type so we can try to add it
title: ''
labels: 'bug'
assignees: ''

---

**Leetcode problem**

<!-- Link to example problem on leetcode where the type is being used-->

**Error Message**

<!-- Please provide a copy of the error received or a screenshot of the error -->

```
```
2 changes: 1 addition & 1 deletion .github/workflows/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test
run: cargo test --all-features

fmt:
name: Rustfmt
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/release_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release Build Confirmation

on:
push:
branches:
- main
pull_request:
types: [ opened, synchronize, reopened ]
branches:
- main
env:
CARGO_TERM_COLOR: always

jobs:
release_compile:
name: Release Compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run Release Compile
run: cargo check --all-features --release
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"cSpell.words": [
"Vecbool",
"Veci"
],
"editor.formatOnSave": true,
"files.autoSave": "onFocusChange",
"rust-analyzer.cargo.features": "all" // Sets the features used by rust analyzer
}
198 changes: 198 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# Contributing

## Where to start

All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome.

The best place to start is to check the [issues](https://github.com/rust-practice/cargo-leet)
for something that interests you.
There are also other options in [discussions](https://github.com/rust-practice/cargo-leet/discussions), so feel free to pick from there as well.

## Bug Reports

Please see the [issue templates](https://github.com/rust-practice/cargo-leet/issues/new/choose) that describe the types of information that we are looking for but no worries just fill it the best you can and we'll go from there.

## Working on the code

### Fork the project

In order to work on the project you will need your own fork. To do this click the "Fork" button on
this project.

Once the project is forked you can work on it directly in github codespaces without needing to install anything by clicking the green button near the top and switching to code spaces.
According to [github docs](https://docs.github.com/en/codespaces/overview#billing-for-codespaces) by default you can only use it up to the free amount so you don't need to worry about charges.
Feel free to check some [notes collected](https://c-git.github.io/github/codespaces/) on how to use codespaces with rust (You don't need trunk for this project).

Alternatively you can clone it to your local machine. The following commands creates the directory cargo-leet and connects your repository to the upstream (main project) repository.

```sh
git clone https://github.com/your-user-name/cargo-leet.git
cd cargo-leet
git remote add upstream [email protected]:rust-practice/cargo-leet.git
```

### Creating a branch

You want your main branch to reflect only production-ready code.
Please base your branch on the develop branch which is the default in cargo-leet repo so create a feature branch for
making your changes.
For example:

```sh
git checkout -b my-new-feature
```

This changes your working directory to the my-new-feature branch. Keep any changes in this branch
specific to one bug or feature so the purpose is clear. You can have many my-new-features and switch
in between them using the git checkout command.

When creating this branch, make sure your develop branch is up to date with the latest upstream
develop version. To update your local develop branch, you can do:

```sh
git checkout develop
git pull upstream develop --ff-only
```

### Code linting, formatting, and tests

You can run linting on your code at any time with:

```sh
cargo clippy
```

To format the code run:

```sh
cargo fmt
```

To run the tests:

Note the following is overridden in `.cargo/config.toml` to run with all features enabled

```sh
cargo t
```

Please run these checks before submitting your pull request.

## Committing your code

Once you have made changes to the code on your branch you can see which files have changed by running:

```sh
git status
```

If new files were created that and are not tracked by git they can be added by running:

```sh
git add .
```

Now you can commit your changes in your local repository:

```sh
git commit -am 'Some short helpful message to describe your changes'
```

## Push your changes

Once your changes are ready and all linting/tests are passing you can push your changes to your forked repository:

```sh
git push origin my-new-feature
```

origin is the default name of your remote repository on GitHub. You can see all of your remote repositories by running:

```sh
git remote -v
```

## Making a Pull Request

After pushing your code to origin it is now on GitHub but not yet part of the cargo-leet project.
When you’re ready to ask for a code review, file a pull request. Before you do, once again make sure
that you have followed all the guidelines outlined in this document regarding code style, tests, and
documentation. You should also double check your branch changes against the branch it was based on by:

1. Navigating to your repository on GitHub
1. Click on Branches
1. Click on the Compare button for your feature branch
1. Select the base and compare branches, if necessary. This will be develop and my-new-feature, respectively.

### Make the pull request

If everything looks good, you are ready to make a pull request. This is how you let the maintainers
of the cargo-leet project know you have code ready to be reviewed. To submit the pull request:

1. Navigate to your repository on GitHub
1. Click on the Pull Request button for your feature branch
1. You can then click on Commits and Files Changed to make sure everything looks okay one last time
1. Write a description of your changes in the Conversation tab
1. Click Send Pull Request

This request then goes to the repository maintainers, and they will review the code.

### Updating your pull request

Changes to your code may be needed based on the review of your pull request.
If this is the case you can make them in your branch, add a new commit to that branch, push it to GitHub, and the pull request will be automatically updated.
Pushing them to GitHub again is done by:

```sh
git push origin my-new-feature
```

This will automatically update your pull request with the latest code and restart the Continuous Integration tests.

Another reason you might need to update your pull request is to solve conflicts with changes that have been merged into the develop branch since you opened your pull request.

To do this, you need to rebase your branch:

```sh
git checkout my-new-feature
git fetch upstream
git rebase upstream/develop
```

There may be some merge conflicts that need to be resolved.
After the feature branch has been update locally, you can now update your pull request by pushing to the branch on GitHub:

```sh
git push origin my-new-feature
```

If you rebased and get an error when pushing your changes you can resolve it with:

```sh
git push origin my-new-feature --force
```

## Delete your merged branch (optional)

Once your feature branch is accepted into upstream, you’ll probably want to get rid of the branch.
First, merge upstream develop into your develop branch so git knows it is safe to delete your branch:

```sh
git fetch upstream
git checkout develop
git merge upstream/develop
```

Then you can do:

```sh
git branch -d my-new-feature
```

Make sure you use a lower-case -d, or else git won’t warn you if your feature branch has not actually been merged.

The branch will still exist on GitHub, so to delete it there do:

```sh
git push origin --delete my-new-feature
```
Loading