Skip to content

Commit

Permalink
Merge pull request #45 from MarcinOrlowski/dev
Browse files Browse the repository at this point in the history
Release 2.1.0
  • Loading branch information
MarcinOrlowski authored Aug 6, 2021
2 parents f14dbe8 + 9c62744 commit 9658710
Show file tree
Hide file tree
Showing 107 changed files with 1,622 additions and 968 deletions.
6 changes: 3 additions & 3 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#
# prop-tool
# Java *.properties file sync checker and syncing tool.
# trans-tool
# The translation files checker and syncing tool.
#
# Copyright ©2021 Marcin Orlowski <mail [@] MarcinOrlowski.com>
# https://github.com/MarcinOrlowski/prop-tool/
# https://github.com/MarcinOrlowski/trans-tool/
#
comment: false
coverage:
Expand Down
29 changes: 15 additions & 14 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# in venv
# pip install wemake-python-styleguide
# flake8 proptool/report/
# flake8 transtool/ tests/
#
# Refactoring hints:
# https://flake8.codes/wemake-python-styleguide/0.15.3/index.html
Expand Down Expand Up @@ -37,7 +37,7 @@ ignore =
E251, # E251 unexpected spaces around keyword / parameter equals
F821, # F821 undefined name 'PropFile'
I001, # I001 isort found an import in the wrong position
I003, # I003 isort expected 1 blank line in imports, found
I003, # I003 isort expected 1 blank line in imports,
I004, # I004 isort found an unexpected blank line in imports
I005, # I005 isort found an unexpected missing import
RST213, # RST213 Inline emphasis start-string without end-string.
Expand Down Expand Up @@ -70,7 +70,7 @@ ignore =
WPS360, # WPS360 Found an unnecessary use of a raw string
WPS420, # WPS420 Found wrong keyword: pass
WPS442, # WPS442 Found outer scope names shadowing:
WPS600, # I001 isort found an import in the wrong position
WPS600, # WPS600 Found subclassing a builtin: list
WPS602, # WPS602 Found using `@staticmethod`
WPS604, # WPS604 Found incorrect node inside `class` body
WPS605, # WPS605 Found method without arguments
Expand All @@ -79,22 +79,23 @@ ignore =
per-file-ignores =
# WPS420 Found wrong keyword: pass
# WPS604 Found incorrect node inside `class` body
proptool/report/error.py: WPS420, WPS604,
proptool/report/warn.py: WPS420, WPS604,
transtool/report/error.py: WPS420, WPS604,
transtool/report/warn.py: WPS420, WPS604,

# WPS230 Found too many public instance attributes
proptool/config/config.py: WPS230,
transtool/config/config.py: WPS230,

# WPS204 Found overused expression: config['opening']; used 5 > 4
# WPS213 Found too many expressions
# WPS301 Found dotted raw import: proptool.checks
# WPS301 Found dotted raw import: transtool.checks
# WPS421 Found wrong function call: dir, print
# WPS437 Found protected attribute usage
# WPS529 Found implicit `.get()` dict usage
# WPS609 Found direct magic attribute usage: __setattr__, __getattr__, ...
# WPS433 Found nested import
# WPS425 Found boolean non-keyword argument: True, False
proptool/config/reader.py: WPS609, WPS421, WPS204, WPS529, WPS433,
proptool/config/builder.py: WPS609, WPS301, WPS437, WPS213, WPS425,
transtool/config/reader.py: WPS609, WPS421, WPS204, WPS529, WPS433,
transtool/config/builder.py: WPS609, WPS301, WPS437, WPS213, WPS425,

# WPS111 Found too short name
# WPS214 Found too many methods
Expand All @@ -103,26 +104,26 @@ per-file-ignores =
# WPS421 Found wrong function call: print
# WPS437 Found protected attribute usage
# WPS518 Found implicit `enumerate()` call
proptool/log.py: WPS214, WPS437, WPS111, WPS317, WPS421, WPS518, WPS323,
transtool/log.py: WPS214, WPS437, WPS111, WPS317, WPS421, WPS518, WPS323,

# WPS201 Found module with too many imports: 13 > 12
# WPS213 Found too many expressions: 13 > 9
# WPS317 Found incorrect multi-line parameters
# WPS323 Found `%` string formatting
proptool/main.py: WPS201, WPS213, WPS317, WPS323,
transtool/main.py: WPS201, WPS213, WPS317, WPS323,

# S101 Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
# WPS421 Found wrong function call: dir
# WPS430 Found nested function: overrider
proptool/decorators/overrides.py: WPS430, S101, WPS421,
transtool/decorators/overrides.py: WPS430, S101, WPS421,

# WPS201 Found module with too many imports: 21 > 12
# WPS230 Found too many public instance attributes
proptool/prop/file.py: WPS201, WPS230,
transtool/prop/file.py: WPS201, WPS230,

# WPS100 Found wrong module name
# WPS421 Found wrong function call: print
proptool/utils.py: WPS421, WPS100,
transtool/utils.py: WPS421, WPS100,

# S311 Standard pseudo-random generators are not suitable for security/cryptographic purposes.
# WPS118 Found too long name
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#
# prop-tool
# Java *.properties file sync checker and syncing tool.
# trans-tool
# The translation files checker and syncing tool.
#
# Copyright ©2021 Marcin Orlowski <mail [@] MarcinOrlowski.com>
# https://github.com/MarcinOrlowski/prop-tool/
# https://github.com/MarcinOrlowski/trans-tool/
#

name: "Coverage"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#
# prop-tool
# Java *.properties file sync checker and syncing tool.
# trans-tool
# The translation files checker and syncing tool.
#
# Copyright ©2021 Marcin Orlowski <mail [@] MarcinOrlowski.com>
# https://github.com/MarcinOrlowski/prop-tool/
# https://github.com/MarcinOrlowski/trans-tool/
#

name: "Code lint"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#
# prop-tool
# Java *.properties file sync checker and syncing tool.
# trans-tool
# The translation files checker and syncing tool.
#
# Copyright ©2021 Marcin Orlowski <mail [@] MarcinOrlowski.com>
# https://github.com/MarcinOrlowski/prop-tool/
# https://github.com/MarcinOrlowski/trans-tool/
#
# Runs markdownlint on all *.md files
#
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#
# prop-tool
# Java *.properties file sync checker and syncing tool.
# trans-tool
# The translation files checker and syncing tool.
#
# Copyright ©2021 Marcin Orlowski <mail [@] MarcinOrlowski.com>
# https://github.com/MarcinOrlowski/prop-tool/
# https://github.com/MarcinOrlowski/trans-tool/
#

name: "Unit tests"
Expand Down
88 changes: 46 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
![prop-tool logo](artwork/prop-tool-logo.png)
![trans-tool logo](artwork/trans-tool-logo.png)

### The *.properties file checker and syncing tool ###
### The translation files checker and syncing tool ###

---

[master](https://github.com/MarcinOrlowski/prop-tool/tree/master) branch:
[![Unit tests](https://github.com/MarcinOrlowski/prop-tool/actions/workflows/unittests.yml/badge.svg?branch=master)](https://github.com/MarcinOrlowski/prop-tool/actions/workflows/unittests.yml)
[![codecov](https://codecov.io/gh/MarcinOrlowski/prop-tool/branch/master/graph/badge.svg?token=3THKJKSQ1G)](https://codecov.io/gh/MarcinOrlowski/prop-tool)
[![Code lint](https://github.com/MarcinOrlowski/prop-tool/actions/workflows/linter.yml/badge.svg?branch=master)](https://github.com/MarcinOrlowski/prop-tool/actions/workflows/linter.yml)
[![MD Lint](https://github.com/MarcinOrlowski/prop-tool/actions/workflows/markdown.yml/badge.svg?branch=master)](https://github.com/MarcinOrlowski/prop-tool/actions/workflows/markdown.yml)
[master](https://github.com/MarcinOrlowski/trans-tool/tree/master) branch:
[![Unit tests](https://github.com/MarcinOrlowski/trans-tool/actions/workflows/unittests.yml/badge.svg?branch=master)](https://github.com/MarcinOrlowski/trans-tool/actions/workflows/unittests.yml)
[![codecov](https://codecov.io/gh/MarcinOrlowski/trans-tool/branch/master/graph/badge.svg?token=3THKJKSQ1G)](https://codecov.io/gh/MarcinOrlowski/trans-tool)
[![Code lint](https://github.com/MarcinOrlowski/trans-tool/actions/workflows/linter.yml/badge.svg?branch=master)](https://github.com/MarcinOrlowski/trans-tool/actions/workflows/linter.yml)
[![MD Lint](https://github.com/MarcinOrlowski/trans-tool/actions/workflows/markdown.yml/badge.svg?branch=master)](https://github.com/MarcinOrlowski/trans-tool/actions/workflows/markdown.yml)

[development](https://github.com/MarcinOrlowski/prop-tool/tree/dev) branch:
[![Unit tests](https://github.com/MarcinOrlowski/prop-tool/actions/workflows/unittests.yml/badge.svg?branch=dev)](https://github.com/MarcinOrlowski/prop-tool/actions/workflows/unittests.yml)
[![codecov](https://codecov.io/gh/MarcinOrlowski/prop-tool/branch/dev/graph/badge.svg?token=3THKJKSQ1G)](https://codecov.io/gh/MarcinOrlowski/prop-tool)
[![Code lint](https://github.com/MarcinOrlowski/prop-tool/actions/workflows/linter.yml/badge.svg?branch=dev)](https://github.com/MarcinOrlowski/prop-tool/actions/workflows/linter.yml)
[![MD Lint](https://github.com/MarcinOrlowski/prop-tool/actions/workflows/markdown.yml/badge.svg?branch=dev)](https://github.com/MarcinOrlowski/prop-tool/actions/workflows/markdown.yml)
[development](https://github.com/MarcinOrlowski/trans-tool/tree/dev) branch:
[![Unit tests](https://github.com/MarcinOrlowski/trans-tool/actions/workflows/unittests.yml/badge.svg?branch=dev)](https://github.com/MarcinOrlowski/trans-tool/actions/workflows/unittests.yml)
[![codecov](https://codecov.io/gh/MarcinOrlowski/trans-tool/branch/dev/graph/badge.svg?token=3THKJKSQ1G)](https://codecov.io/gh/MarcinOrlowski/trans-tool)
[![Code lint](https://github.com/MarcinOrlowski/trans-tool/actions/workflows/linter.yml/badge.svg?branch=dev)](https://github.com/MarcinOrlowski/trans-tool/actions/workflows/linter.yml)
[![MD Lint](https://github.com/MarcinOrlowski/trans-tool/actions/workflows/markdown.yml/badge.svg?branch=dev)](https://github.com/MarcinOrlowski/trans-tool/actions/workflows/markdown.yml)

---

Expand All @@ -33,49 +33,53 @@

## Introduction ##

`prop-tool` is a small but powerful utility aimed at your projects' `*.properties` files. It looks like text based INI file, but it
is even simpler and because to its simplicity, this file format is often used to keep the configurations or translations (i.e. in
Java world). Example file:
`trans-tool` is a small but powerful utility aimed at your projects' translation files. It is armed
with several validators to watch for common mistakes in translations as well as base strings. It currently
loads `*.properties` files, which is file format often used in Java projects as the `trans-tool` was born
while working on [Logisim-evolution](https://github.com/logisim-evolution/logisim-evolution/).

Example `*.properties` file looks like simplified version of commonly used INI file:

```ini
# Example of *.properties file
programTitle = Prop-Tool v1.3
programTitle = trans-tool v2.0.0
okButton = "OK"
```

The main role of `prop-tool` is to help you keep your `*.properties` files in order, ensuring all files are
syntactically correct and all the translation files are in sync with base (main language) file. It also comes with huge set of
Internally, `trans-tool` works on abstract format, thus adding support for other file formats can easy be added
which will happen upon demand.

While loading your `*.properties` files `trans-tool` checks if files are in order, ensuring all of them are
syntactically correct and all of the translations are in sync with main language. It also comes with huge set of
various linters and checkers to guard quality of the files' contents. It can check for missing or dangling keys, inproper
punctuation, open brackets, quotation marks and more. It can also automatically sync translation files quickly providing fresh
template for your translators to work on.
punctuation, open brackets, quotation marks and more. It can also automatically sync translation files quickly providing
fresh template for your translators to work on.

```bash
$ prop-tool -b mark -l pl -v
Base: mark.properties
Warnings: 1
$ trans-tool -b soc -l pl

Base: src/main/resources/resources/logisim/strings/soc/soc.properties
Errors: 1
Brackets
W: Line 3:16: No closing bracket for "<"
PL: brackets_pl.properties
Errors: 8, warnings: 3
Sentence starts with different letter case.
E: Line 8: "missingClosing" starts with lower-cased character. Expected UPPER-cased.
Trailing white characters
W: line 2: In comment: 2
E: line 4: In "question" entry: 1
E: Line 163:90: "AssemblerRunSuccess": No opening character matching ")".
PL: src/main/resources/resources/logisim/strings/soc/soc_pl.properties
Errors: 3, warnings: 4
Brackets
E: Line 175:83: "AssemblerRunSuccess": No opening character matching ")".
Formatting values
E: Line 383:167: "PioMenuOutClearRemark": Expected "%s", found "%s.".
E: Line 387:167: "PioMenuOutSetRemark": Expected "%s", found "%s.".
Missing translations
W: "ElfHeaderEIDataError": Missing translation.
W: "AsmPanErrorCreateFile": Missing translation.
Punctuation mismatch
E: line 3: "exclamation" ends with " ". Expected "!".
E: line 4: "newline" ends with "". Expected "\n".
Bracket mismatch
E: Line 2:1: "missingClosing": No closing bracket for "(".
W: Line 3:16: No closing bracket for "<"
E: Line 4:4: "missingOpening": No opening bracket matching ")".
Quotation marks
E: Line 12:5: "missingSingle": Quotation mark mismatch. Expected ", found `.
E: Line 13:5: "remaining": Quotation mark mismatch. Expected ", found `.
W: Line 14:11: No closing mark for ".
W: Line 12: "SocInsertTransWindowTitle": Ends with "y". Expected ":".
First words case mismatch.
W: Line 332: "Rv32imProgramCounter": Starts UPPER-cased, expected lower-case.
```
## License ##
* Written and copyrighted &copy;2021 by Marcin Orlowski <mail (#) marcinorlowski (.) com>
* prop-tool is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)
* trans-tool is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).
* Project logo contains [elements from Flaticon.com](https://www.flaticon.com/free-icon/translation_99694).
Binary file removed artwork/prop-tool-logo.png
Binary file not shown.
Binary file added artwork/trans-tool-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9658710

Please sign in to comment.