smart-commit-tool 1.0.1__tar.gz → 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: smart-commit-tool
3
- Version: 1.0.1
3
+ Version: 1.1.0
4
4
  Summary: Automated pre-push workflow manager with built-in code quality enforcement and smart branch protection.
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.11
@@ -12,6 +12,11 @@ Description-Content-Type: text/markdown
12
12
 
13
13
  [English](README.md) | [Русский](README.ru.md)
14
14
 
15
+ [![PyPI version](https://img.shields.io/pypi/v/smart-commit-tool?color=blue&logo=pypi&logoColor=white)](https://pypi.org/project/smart-commit-tool/)
16
+ [![Python Version](https://img.shields.io/badge/python-3.8+-blue?logo=python&logoColor=white)](https://pypi.org/project/smart-commit-tool/)
17
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
18
+ [![GitHub stars](https://img.shields.io/github/stars/mokinprokin/smart_commit?style=social)](https://github.com/mokinprokin/smart_commit/stargazers)
19
+
15
20
  **Smart Commit** is a universal CLI tool designed to streamline and secure your Git workflow. It orchestrates linting, testing, committing, and pushing into a single, bulletproof operation.
16
21
 
17
22
  **The Golden Rule:** If your tests fail, your code doesn't ship.
@@ -86,6 +91,7 @@ smart-commit
86
91
  4. **Optimized Push**: Automatically handles `add` and `commit`. If the remote branch has moved forward, it helps you `rebase` to ensure a linear, clean history.
87
92
 
88
93
  ---
94
+ ![Демонстрация smart-commit](assets/demonstration.gif)
89
95
 
90
96
  ## 📄 License
91
97
  Distributed under the MIT License. Feel free to use, modify, and share!
@@ -2,6 +2,11 @@
2
2
 
3
3
  [English](README.md) | [Русский](README.ru.md)
4
4
 
5
+ [![PyPI version](https://img.shields.io/pypi/v/smart-commit-tool?color=blue&logo=pypi&logoColor=white)](https://pypi.org/project/smart-commit-tool/)
6
+ [![Python Version](https://img.shields.io/badge/python-3.8+-blue?logo=python&logoColor=white)](https://pypi.org/project/smart-commit-tool/)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+ [![GitHub stars](https://img.shields.io/github/stars/mokinprokin/smart_commit?style=social)](https://github.com/mokinprokin/smart_commit/stargazers)
9
+
5
10
  **Smart Commit** is a universal CLI tool designed to streamline and secure your Git workflow. It orchestrates linting, testing, committing, and pushing into a single, bulletproof operation.
6
11
 
7
12
  **The Golden Rule:** If your tests fail, your code doesn't ship.
@@ -76,6 +81,7 @@ smart-commit
76
81
  4. **Optimized Push**: Automatically handles `add` and `commit`. If the remote branch has moved forward, it helps you `rebase` to ensure a linear, clean history.
77
82
 
78
83
  ---
84
+ ![Демонстрация smart-commit](assets/demonstration.gif)
79
85
 
80
86
  ## 📄 License
81
87
  Distributed under the MIT License. Feel free to use, modify, and share!
@@ -75,6 +75,7 @@ smart-commit
75
75
  4. **Умный Push**: Инструмент сам сделает `add`, `commit` и отправит код. Если на сервере появились новые изменения, он предложит сделать `rebase`, чтобы история оставалась чистой.
76
76
 
77
77
  ---
78
+ ![Демонстрация smart-commit](assets/demonstration.gif)
78
79
 
79
80
  ## 📄 Лицензия
80
81
  Распространяется под лицензией **MIT**. Пользуйтесь, меняйте и делитесь с друзьями!
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "smart-commit-tool"
7
- version = "1.0.1"
7
+ version = "1.1.0"
8
8
  description = "Automated pre-push workflow manager with built-in code quality enforcement and smart branch protection."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -45,6 +45,12 @@ class GitService:
45
45
  error_msg = res.stderr.strip() or res.stdout.strip()
46
46
  raise GitOperationError(f"Failed to switch branch: {error_msg}")
47
47
 
48
+ @classmethod
49
+ def has_any_changes(cls) -> bool:
50
+ """Checks if there are any staged, unstaged, or untracked changes."""
51
+ res = cls._run(["git", "status", "--porcelain"])
52
+ return bool(res.stdout.strip())
53
+
48
54
  @classmethod
49
55
  def has_staged_changes(cls) -> bool:
50
56
  """Checks if there are files already in the staging area."""
@@ -13,6 +13,7 @@ __pycache__/
13
13
  venv/
14
14
  env/
15
15
  .env*
16
+ *.env
16
17
  !.env.example
17
18
  .vscode/
18
19
  .idea/
@@ -39,16 +40,20 @@ node_modules/
39
40
  @classmethod
40
41
  def check_env_leaks(cls):
41
42
  """
42
- Scans for .env* files and uses Git to check if they are ignored.
43
+ Scans for .env files (e.g. .env.local, .test.env, prod.env)
44
+ and uses Git to check if they are ignored.
43
45
  Prevents accidental leaks of secrets.
44
46
  """
45
47
  Console.info("🛡️ Scanning for potential secret leaks (.env files)...")
46
48
 
49
+ raw_files = set(Path(".").rglob(".env*")) | set(Path(".").rglob("*.env"))
50
+
47
51
  env_files = [
48
52
  f
49
- for f in Path(".").rglob(".env*")
50
- if not any(
51
- part in ["venv", ".venv", "env", "node_modules", ".git"]
53
+ for f in raw_files
54
+ if f.is_file()
55
+ and not any(
56
+ part in ["venv", ".venv", "env", "node_modules", ".git", "__pycache__"]
52
57
  for part in f.parts
53
58
  )
54
59
  ]