-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create a simple CONTRIBUTING.md * add a newline * More details * add info about typescript * Update README.md * simplify script * add eslint * Update CONTRIBUTING.md --------- Co-authored-by: grqx_wsl <[email protected]>
- Loading branch information
Showing
2 changed files
with
50 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
### Coding conventions | ||
|
||
Since the provider consists of two parts(the **Provider**(coded in typescript) and the **Provider plugin**(coded in python)), we have different code formatting standards for them. | ||
Please format your code by running this script below before you push a commit: | ||
|
||
```shell | ||
# Make sure you have ruff, autopep8, eslint and prettier installed already | ||
ruff check --fix plugin/ | ||
autopep8 --in-place plugin/ | ||
|
||
cd server | ||
npx eslint --fix --max-warnings=0 src/ | ||
npx prettier --check --write "src/**/*.{js,ts}" | ||
cd .. | ||
``` | ||
|
||
If you don't want the code formatter to fix your code automatically, you may check if there's any problem with your code with this script: | ||
|
||
```shell | ||
# Make sure you have ruff, autopep8, eslint and prettier installed already | ||
ruff check plugin/ | ||
autopep8 plugin/ | ||
|
||
cd server | ||
npx eslint --max-warnings=0 src/ | ||
npx prettier --check "src/**/*.{js,ts}" | ||
cd .. | ||
``` | ||
|
||
#### **Provider**(typescript): | ||
Please make sure your code passes eslint and prettier checks by running the script above. | ||
|
||
#### **Provider plugin**(python): | ||
As a yt-dlp plugin, we follow the [yt-dlp coding conventions](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#yt-dlp-coding-conventions). You can use ruff and autopep8 to format your code, as shown in the script above. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters