Skip to content

Commit

Permalink
refactor: split code to multi-project workspace (geo, http, models li… (
Browse files Browse the repository at this point in the history
#5)

* refactor: split code to multi-project workspace (geo, http, models libraries)

### Key Changes
- **Geographical Data Handling (`ralertsinua-geo`)**: Introduction of modules for mapping in Ukraine, handling geometric data, and structures for map bounds.
- **HTTP Client Functionality (`ralertsinua-http`)**: Refactoring of `AlertsInUaClient` to simplify configuration handling by accepting `base_url` and `token` directly in its constructor.
- **Data Models (`ralertsinua-models`)**: New data structures for representing geographical regions and encapsulation of models in a new module for accessibility.
- **General Refactoring**: Updates to import statements and configurations to align with the new project structure.

These changes aim to enhance modularity, maintainability, and scalability of the codebase by segregating different functionalities into distinct libraries.
  • Loading branch information
voznik authored May 5, 2024
1 parent 2c4fb54 commit 197d420
Show file tree
Hide file tree
Showing 59 changed files with 2,270 additions and 1,990 deletions.
11 changes: 0 additions & 11 deletions .data/config.toml

This file was deleted.

17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EditorConfig is awesome: http://EditorConfig.org

root = true

[*]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export {{crate_name | shouty_snake_case}}_CONFIG=`pwd`/.config
export {{crate_name | shouty_snake_case}}_DATA=`pwd`/.data
export {{crate_name | shouty_snake_case}}_LOG_LEVEL=debug
export {{crate_name | shouty_snake_case}}_LOG_LEVEL=debug
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Set the default behavior for all files.
* text=auto eol=lf

# Normalized and converts to native line endings on checkout.
*.rs text
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
with:
args: >
-Dsonar.externalIssuesReportPaths=sonar-issues.json
-Dcommunity.rust.lcov.reportPaths=lcov.info
-Dcommunity.rust.lcov.reportPaths=lcov.info
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ rust-project.json
.ionide

### Local
# Ignore all local history of files
.data/*.sqlite
.data/*.log
tmp/
assets/*.sqlite

# End of https://www.toptal.com/developers/gitignore/api/rust,rust-analyzer,visualstudiocode,dotenv
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-merge-conflict
- id: check-case-conflict
- id: detect-private-key
- repo: https://github.com/doublify/pre-commit-rust
rev: master
hooks:
- id: fmt
- id: cargo-check
- id: clippy
exclude: '.vscode'
default_stages:
- 'pre-commit'
- 'pre-push'
23 changes: 10 additions & 13 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
Expand All @@ -12,11 +9,11 @@
"args": [
// "watch -x",
"build",
"--bin=alertsinua-tui",
"--package=alertsinua-tui"
"--bin=ralertsinua",
"--package=ralertsinua"
],
"filter": {
"name": "alertsinua-tui",
"name": "ralertsinua",
"kind": "bin"
}
},
Expand All @@ -30,16 +27,16 @@
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'alertsinua-tui'",
"name": "Debug unit tests in library 'ralertsinua'",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=alertsinua-tui"
"--package=ralertsinua"
],
"filter": {
"name": "alertsinua-tui",
"name": "ralertsinua",
"kind": "lib"
}
},
Expand All @@ -49,16 +46,16 @@
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'alertsinua-tui'",
"name": "Debug unit tests in executable 'ralertsinua'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=alertsinua-tui",
"--package=alertsinua-tui"
"--bin=ralertsinua",
"--package=ralertsinua"
],
"filter": {
"name": "alertsinua-tui",
"name": "ralertsinua",
"kind": "bin"
}
},
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"lldb.showDisassembly": "auto",
"lldb.dereferencePointers": true,
"lldb.consoleMode": "evaluate"
}
}
Loading

0 comments on commit 197d420

Please sign in to comment.