Skip to content

Commit

Permalink
Merge pull request #457 from maooyer/pre-commit-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Rongronggg9 authored May 11, 2024
2 parents 1e66c03 + 947f1da commit ed59aaa
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 20 deletions.
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This is the configuration file for pre-commit (https://pre-commit.com/).
# To use:
# * Install pre-commit (https://pre-commit.com/#installation)
# * Copy this file as ".pre-commit-config.yaml"
# * Run "pre-commit install".

default_install_hook_types: [commit-msg, pre-commit]
ci:
autofix_commit_msg: "fix: auto fix by pre-commit hooks"
autofix_prs: true
autoupdate_branch: dev
autoupdate_schedule: monthly
autoupdate_commit_msg: "ci(pre-commit): auto update by pre-commit hooks"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
types: [python]
- id: mixed-line-ending
args: [ "--fix=lf" ]
- id: trailing-whitespace
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ You can help to translate the bot using [Hosted Weblate](https://hosted.weblate.

## Using the public bot

The [public bot](https://t.me/RSStT_Bot) comes with absolutely no warranty. I will try my best to maintain it, but I cannot guarantee that it will always work perfectly. Meanwhile, you should "fair use" the bot, avoid subscribing to too many RSS feeds.
The [public bot](https://t.me/RSStT_Bot) comes with absolutely no warranty. I will try my best to maintain it, but I cannot guarantee that it will always work perfectly. Meanwhile, you should "fair use" the bot, avoid subscribing to too many RSS feeds.\
If you use the [public bot](https://t.me/RSStT_Bot) in your Channel, consider mentioning the bot (or this project) in your channel description (or pinned message) to let more people know about it. That's not a compulsion.

## Known channels using RSStT
Expand Down
2 changes: 1 addition & 1 deletion README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

## 使用公共 bot

[公共 bot](https://t.me/RSStT_Bot) 没有服务保障。我会尽我所能维护它,但不能保证它永远完美运作。同时,你应该遵循“公平使用”,避免订阅过多 RSS 源。
[公共 bot](https://t.me/RSStT_Bot) 没有服务保障。我会尽我所能维护它,但不能保证它永远完美运作。同时,你应该遵循“公平使用”,避免订阅过多 RSS 源。\
如果你在频道里使用[公共 bot](https://t.me/RSStT_Bot) ,请考虑在频道简介 (或置顶消息) 里提及这个 bot (或这个项目),来让更多人了解本项目。这不是强制的。

## 使用 RSStT 的频道
Expand Down
4 changes: 2 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
### Bug fixes

- **Stay in topic group even when the "General" topic is closed**: Now that topic groups are not fully supported, the bot can only send messages in the "General" topic. Previously, the bot would only send an error message to the bot manager if the "General" topic is closed. Now the bot will leave the topic group, without disturbing the bot manager, if the "General" topic is closed. This is a temporary limitation before topic groups are fully supported.
- **v2.4.1 not released to PyPI**: Due to a previous mistake, v2.4.1 could not be released to PyPI. v2.5.0 fixes the mistake and is released to PyPI.
- **v2.4.1 not released to PyPI**: Due to a previous mistake, v2.4.1 could not be released to PyPI. v2.5.0 fixes the mistake and is released to PyPI.

## v2.4.1: Minor enhancements, bug fixes, and Happy New Year!

Expand Down Expand Up @@ -283,7 +283,7 @@ Official public bot [@RSStT_Bot](https://t.me/RSStT_Bot) is always using the `de

Official public bot: [@RSStT_Bot](https://t.me/RSStT_Bot)

**This is a major release. It introduces some major breaking changes. You must migrate to the new version manually.**
**This is a major release. It introduces some major breaking changes. You must migrate to the new version manually.**\
**PLEASE READ THE [MIGRATION GUIDE](migration-guide-v2.md) BEFORE UPDATING!**

### BREAKING CHANGES
Expand Down
2 changes: 1 addition & 1 deletion docs/CHANGELOG.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@

官方的公开 bot: [@RSStT_Bot](https://t.me/RSStT_Bot)

**这是一个重大的发布。它引入了一些重大变更,因此迁移至新版本需要手动完成。**
**这是一个重大的发布。它引入了一些重大变更,因此迁移至新版本需要手动完成。**\
**更新前请务必阅读[迁移指南](migration-guide-v2.zh.md)**

### 重大变更
Expand Down
10 changes: 5 additions & 5 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

### **Q**: How is the performance of the bot?

**A**: The bot is designed to be asynchronous, so it is lightweight and fast. Even if there are over 6000 feeds, the bot can still run on a single core VPS, with an incredibly low load average (~0.2) and approximate 350MB memory usage. The bot can still work fine in such a condition and its stability and usability will not be degraded.
**A**: The bot is designed to be asynchronous, so it is lightweight and fast. Even if there are over 6000 feeds, the bot can still run on a single core VPS, with an incredibly low load average (~0.2) and approximate 350MB memory usage. The bot can still work fine in such a condition and its stability and usability will not be degraded.

### **Q**: It appears to have a slight memory leak problem...

Expand All @@ -26,14 +26,14 @@

### **Q**: I want my bot to serve me only. What should I do?

**A**: Set the env variable `MULTIUSER` to `0`.
If you need to use the bot in a channel, read the next question.
**A**: Set the env variable `MULTIUSER` to `0`.\
If you need to use the bot in a channel, read the next question.\
Using the bot in a group is possible even if you don't have the multi-user mode enabled, as long as you are a non-anonymous administrator of the group. If you are an anonymous administrator of the group, read the next question.

### **Q**: I want my bot to serve the users/channels/groups I specify only. What should I do?

**A**: Firstly, set the env variable `MULTIUSER` to `0`. This will make guests unable to use the bot.
If you want to allow a certain user to use the bot, send `/user_info user_id` or `/user_info @username` to the bot and promote their to "User".
**A**: Firstly, set the env variable `MULTIUSER` to `0`. This will make guests unable to use the bot.\
If you want to allow a certain user to use the bot, send `/user_info user_id` or `/user_info @username` to the bot and promote their to "User".\
If you want to allow a certain channel/group to use the bot, you should promote both the channel/group itself and at least one of its administrators to "User". Only the promoted administrators can operate the bot in the channel/group.

### **Q**: Why did the bot automatically leave my channel/group?
Expand Down
8 changes: 4 additions & 4 deletions docs/FAQ.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@

### **Q**: 我希望我的 bot 仅为我服务。我应该怎么做?

**A**: 将环境变量 `MULTIUSER` 设置为 `0`
如果你需要在频道里使用 bot,请阅读下一个问题。
**A**: 将环境变量 `MULTIUSER` 设置为 `0`\
如果你需要在频道里使用 bot,请阅读下一个问题。\
即使没有启用多用户模式,在群组里使用 bot 也是可能的,只要你是群组的非匿名管理员就可以。如果你是群组的匿名管理员,请阅读下一个问题。

### **Q**: 我希望我的 bot 仅为我指定的用户/频道/群组服务。我应该怎么做?

**A**: 首先,将环境变量 `MULTIUSER` 设置为 `0`。这将使访客无法使用 bot。
如果你想要允许某个用户使用 bot,向 bot 发送 `/user_info 用户ID``/user_info @用户名`,然后将他提升为「用户」。
**A**: 首先,将环境变量 `MULTIUSER` 设置为 `0`。这将使访客无法使用 bot。\
如果你想要允许某个用户使用 bot,向 bot 发送 `/user_info 用户ID``/user_info @用户名`,然后将他提升为「用户」。\
如果你想要允许某个频道/群组使用 bot,你需要将频道/群组本身和至少一位它的管理员提升为提升为「用户」。只有被提升的管理员才可以在频道/群组里操作 bot。

### **Q**: 为什么 bot 自动退出了我的频道/群组?
Expand Down
6 changes: 3 additions & 3 deletions docs/deployment-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ _Please note that if you deploy RSStT without using the above buttons, you must

## Option 3: ~~Heroku~~

> ~~Heroku accounts with no verified payment method have only 550 hours of credit per month (about 23 days), and up to 1,000 hours per month with any verified payment methods.~~
> ~~Heroku accounts with no verified payment method have only 550 hours of credit per month (about 23 days), and up to 1,000 hours per month with any verified payment methods.~~\
> [Heroku no longer offers free plans](https://blog.heroku.com/next-chapter). Deploying RSStT on Heroku could cost you at least $16 per month ($7 for Heroku Dyno and $9 for Heroku Postgres). [Railway.app](#option-2-railwayapp) offers lower price and better performance.
### Deploy
Expand Down Expand Up @@ -121,10 +121,10 @@ You know what to do. However, I cannot guarantee that the fonts can be recognize
[![TestPyPI publish status](https://img.shields.io/github/actions/workflow/status/Rongronggg9/RSS-to-Telegram-Bot/publish-to-test-pypi.yml?label=publish%20(TestPyPI)&logo=pypi&logoColor=white)](https://github.com/Rongronggg9/RSS-to-Telegram-Bot/actions/workflows/publish-to-test-pypi.yml)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/rsstt?logo=pypi&logoColor=white)](https://pypi.org/project/rsstt/)

> Create a virtual environment (`venv`) and activate it first if needed.
> Create a virtual environment (`venv`) and activate it first if needed.\
> Default config folder is `~/.rsstt`.
> `pip3 install -U rsstt` will install the latest **stable** version from [PyPI](https://pypi.org/project/rsstt), which **may be outdated**.
> `pip3 install -U rsstt` will install the latest **stable** version from [PyPI](https://pypi.org/project/rsstt), which **may be outdated**.\
> `pip3 install -U --extra-index-url https://test.pypi.org/simple rsstt` will install the latest **dev** version from [TestPyPI](https://test.pypi.org/project/rsstt), which is **always up-to-date**.
```sh
Expand Down
6 changes: 3 additions & 3 deletions docs/formatting-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@

| | RSStT | flowerss |
|:---------------------:|:-------------------------------:|:----------------------------------:|
| Telegram message | ![](resources/RSStT_tgmsg.jpg) | ![](resources/flowerss_tgmsg.jpg) |
| Telegraph | ![](resources/RSStT_tgraph.jpg) | ![](resources/flowerss_tgraph.jpg) |
| Only title and source | ![](resources/RSStT_t&s.jpg) | ![](resources/flowerss_t&s.jpg) |
| Telegram message | ![](resources/RSStT_tgmsg.jpg) | ![](resources/flowerss_tgmsg.jpg) |
| Telegraph | ![](resources/RSStT_tgraph.jpg) | ![](resources/flowerss_tgraph.jpg) |
| Only title and source | ![](resources/RSStT_t&s.jpg) | ![](resources/flowerss_t&s.jpg) |

0 comments on commit ed59aaa

Please sign in to comment.