Read more about the [simple definition format](https://github.com/Jackett/Jackett/wiki/Definition-format).
# Contributing Code
While reporting the bugs is super helpful since you can't fix bugs you don't know about, they don't get fixed unless someone goes in and fixes them.
Luckily, you're a developer who wants to help us do just that. Thanks!
We really need more developers working on Jackett, no matter their skill level or walk of life.
We've developed the guide below to make sure we're all on the same page because this makes reading and fixing code much simpler, faster, and less bug-prone.
## Setting up your environment
The following guide assumes you've never worked with a Visual Studio project with GitHub before.
This will give you the minimum necessary tools to get started. There are plenty of optional tools that may help you, but we won't cover those here.
- The guide is currently only geared towards developing on Windows using Visual Studio Community 2019.
If you use something else, please add it here for others.
<detailsopen=true><summary> Windows </summary>
<detailsopen=true><summary> Visual Studio 2019 </summary>
- Install [Visual Studio Community 2019](http://visualstudio.com) for free.
- About 2GB download. 8GB installed.
- Make sure it includes the following Workloads/Components:
- .Net Desktop Development
- .Net Core Cross-Platform Development
- GitHub extension for Visual Studio
- [Connect and synchronize your forked repository to Visual Studio](https://doc.fireflymigration.com/working-with-github-fork-in-visual-studio.html)
- From the PMC, run `dotnet tool install -g dotnet-format` and `dotnet restore`
- Run `Build -> Rebuild Solution` to restore NuGet packages
- Ensure `Jackett.Server` is the Startup Project (instead of `Jackett.Service`), and the Run Target (instead of `IIS Express`)
</details>
</details>
## Coding Style
Now that you're ready to code, it's time to teach you our style guidelines. This style guide helps our code stay readable and bug-free.
You can see the full details in the [Editor Config](.editorconfig) file.
Running `dotnet format` from the Package Manager Console will apply the style guide to the solution and is required before any pull request will be accepted.
- Whitespace
- Indenting is done with 4 spaces
- No whitespace at the end of lines
- All files have a final newline
- Unix style new lines for committed code
- Spaces around all non-unary operators
- Braces
- Opening brace on its own line
- Single line statements do not use braces
- If any part of an `if ... else if ... else` block needs braces, all blocks will use braces
- Naming
-`interface` names begin with I and are `PascalCase`
-`private` variables begin with _ and are `camelCase`
-`private static` variables begin with s_ and are `camelCase`
- local variables are `camelCase`
-`async` function names end with Async
- all others are `PascalCase`
- Others
- Prefer `var` for declarations
- Prefer modern language enhancements (C#7, C#8 features)
- switch expressions
- range operator
- using statements
-`default` over `default(T)`
- Prefer conditional access `?.` and null coalescing `??` over null checks
- Prefer pattern matching
- Prefer expression bodies
- Avoid `this` qualifier
-`using` statements go outside namespace declaration and are sorted: