Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
fdd052a
unused_code: handle git grep no-matches and untracked; detect pytest …
myakove Aug 9, 2025
c83ead3
tests(unused_code): use bytes for FakeCompleted stdout/stderr to matc…
myakove Aug 9, 2025
6fe4908
fix(unused_code): normalize _git_grep behavior; formatting after pre-…
myakove Aug 9, 2025
0e62ab5
fix(unused_code): parse git grep -n output with split(':', 2) to isol…
myakove Aug 9, 2025
b4cdf1f
tests(unused_code): add commented-usage test; fix mock to use text st…
myakove Aug 9, 2025
261388e
feat(jira_utils): prefer config values when present, fallback to CLI/…
myakove Aug 9, 2025
818fbbf
feat(unused_code): detect supported git grep regex flag (-P or -G) on…
myakove Aug 9, 2025
8189f2f
fix(unused_code): tighten call-site regex with word boundary; add por…
myakove Aug 9, 2025
9507035
feat(unused_code): aggregate processing errors instead of exiting on …
myakove Aug 9, 2025
8cd8c3a
feat(unused_code): enhance git grep reliability and cross-platform co…
myakove Aug 9, 2025
136b355
Add AI files to gitignore
myakove Aug 9, 2025
c421608
fix(unused_code): improve git grep output parsing and regex portability
myakove Aug 9, 2025
46adfac
refactor(jira_utils): simplify config precedence logic for url and token
myakove Aug 9, 2025
ec79dc8
fix(unused_code): filter documentation patterns to prevent false posi…
myakove Aug 11, 2025
b6d2ab7
Merge branch 'main' of github.com:RedHatQE/python-utility-scripts int…
myakove Aug 13, 2025
f96b127
refactor(unused_code): add unused_code_ prefix to test functions
myakove Aug 13, 2025
01995c0
fix: used function as arg
myakove Aug 22, 2025
74a2319
Merge branch 'main' of github.com:RedHatQE/python-utility-scripts int…
myakove Aug 22, 2025
6e62487
fix(unused_code): functions in docs
myakove Aug 22, 2025
dfc0ed6
Merge branch 'main' of github.com:RedHatQE/python-utility-scripts int…
myakove Aug 25, 2025
80dcc4e
Merge branch 'main' of github.com:RedHatQE/python-utility-scripts int…
myakove Aug 28, 2025
57d4933
fix: do not count imports as using the function
myakove Aug 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,11 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

# AI
.cursor/
CLAUDE.md
.agent-os/
.cursorrules
.claude/
GEMINI.md
Empty file removed 18
Empty file.
1 change: 1 addition & 0 deletions apps/jira_utils/jira_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def process_jira_command_line_config_file(
config_dict = get_util_config(util_name="pyutils-jira", config_file_path=config_file_path)
url = url or config_dict.get("url", "")
token = token or config_dict.get("token", "")

if not (url and token):
LOGGER.error("Jira url and token are required.")
sys.exit(1)
Expand Down
31 changes: 31 additions & 0 deletions apps/unused_code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,42 @@ Helper to identify unused code in a pytest repository. It should be run from ins

## Usage

### Basic Usage

```bash
# Analyze all Python files in the current directory (must be a git repository)
pyutils-unusedcode

# Show help with all available options
pyutils-unusedcode --help
```

### Analyze Specific Files or Directories

```bash
# Analyze a single Python file
pyutils-unusedcode --file-path /path/to/your/file.py
pyutils-unusedcode -f /path/to/your/file.py

# Analyze all Python files in a specific directory recursively
pyutils-unusedcode --directory /path/to/your/project
pyutils-unusedcode -d /path/to/your/project
```

**Note:** When using `--file-path` or `--directory`, the tool will analyze files from any git repository, not just the current working directory.

## Command-Line Options

| Option | Short | Description |
|--------|-------|-------------|
| `--file-path` | `-f` | Analyze a single Python file for unused functions. Must be an existing .py file. |
| `--directory` | `-d` | Analyze all Python files in a directory recursively for unused functions. Must be an existing directory. |
| `--exclude-files` | | Comma-separated list of files to exclude from analysis. |
| `--exclude-function-prefixes` | | Comma-separated list of function prefixes to exclude from analysis. |
| `--config-file-path` | | Path to custom config file (default: `~/.config/python-utility-scripts/config.yaml`). |
| `--verbose` | `-v` | Enable verbose logging for debugging. |
| `--help` | | Show help message with all available options. |

## Config file

To skip unused code check on specific files or functions of a repository, a config file with the list of names of such files and function prefixes should be added to
Expand Down
Loading