-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General Code sanitation and several fixes (#396)
- Loading branch information
Showing
44 changed files
with
815 additions
and
632 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,38 @@ | ||
|
||
## Code Style | ||
|
||
We use [Black](https://black.readthedocs.io/en/stable/) (PEP 8 compliant) for code formatting. | ||
|
||
Install it to format your code after writing code or use it in your IDE as code formatter. | ||
|
||
To format run: | ||
|
||
```sh | ||
black dialect | ||
``` | ||
|
||
We also use [isort](https://pycqa.github.io/isort/) for imports sorting. | ||
|
||
```sh | ||
isort dialect | ||
``` | ||
|
||
### Type Annotations | ||
|
||
We try to use Python type annotations whenever is possible. | ||
|
||
#### When to omit annotations? | ||
|
||
- Explicit classes instantiation like: | ||
|
||
```python | ||
var = Class() | ||
``` | ||
|
||
- Non-nullable argument with default value: | ||
|
||
```python | ||
# We omit `int` typing for `number` | ||
def method(text: str, number = 5, other: int | None = 20): | ||
... | ||
``` |
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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,10 @@ | ||
APP_ID: str | ||
PROFILE: str | ||
RES_PATH: str | ||
VERSION: str | ||
|
||
TRANS_NUMBER: int | ||
|
||
LANG_ALIASES: dict[str, str] | ||
|
||
LANGUAGES: dict[str, str] |
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,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<gresources> | ||
<gresource prefix="/app/drey/Dialect"> | ||
<file compressed="true">style.css</file> | ||
<file compressed="true">style-dark.css</file> | ||
|
||
<file compressed="true" preprocess="xml-stripblanks">preferences.ui</file> | ||
<file compressed="true" preprocess="xml-stripblanks">shortcuts.ui</file> | ||
<file compressed="true" preprocess="xml-stripblanks">window.ui</file> | ||
<file compressed="true" preprocess="xml-stripblanks">widgets/lang_row.ui</file> | ||
<file compressed="true" preprocess="xml-stripblanks">widgets/lang_selector.ui</file> | ||
<file compressed="true" preprocess="xml-stripblanks">widgets/provider_preferences.ui</file> | ||
<file compressed="true" preprocess="xml-stripblanks">widgets/theme_switcher.ui</file> | ||
|
||
<file compressed="true" preprocess="xml-stripblanks" alias="appdata.xml">@appstream-path@</file> | ||
</gresource> | ||
|
||
<gresource prefix="/app/drey/Dialect/icons/scalable/emblems/"> | ||
<file preprocess="xml-stripblanks" alias="dialect-settings-symbolic.svg">icons/settings-symbolic.svg</file> | ||
</gresource> | ||
</gresources> |
File renamed without changes
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
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
Oops, something went wrong.