Skip to content

Commit fabea34

Browse files
committed
fix: replace bare except with Exception in SyncOntology.__eq__
- Fix ruff E722 error: bare except not allowed - Update repo-memory.md to emphasize running ruff before pushing - Add mandatory pre-push workflow matching GitHub Actions CI - Document that CI runs 'ruff check' without --fix flag
1 parent 53f9370 commit fabea34

2 files changed

Lines changed: 28 additions & 9 deletions

File tree

.copilot/repo-memory.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,45 @@ conda activate temp_owlapy && coverage report -m
4242

4343
## Pull Request Workflow
4444

45-
**CRITICAL: Always run tests BEFORE creating a pull request!**
45+
**CRITICAL: Always run linter AND tests BEFORE pushing code or creating a pull request!**
4646

47-
### Pre-PR Checklist
48-
1. ✅ Run linter and fix issues:
47+
### Pre-PR Checklist (MANDATORY)
48+
49+
Follow this exact sequence before pushing to GitHub:
50+
51+
1.**Activate conda environment**:
52+
```bash
53+
conda activate temp_owlapy
54+
```
55+
56+
2.**Run ruff linter** (matches GitHub Actions CI):
4957
```bash
5058
ruff check owlapy --line-length=200 --fix --unsafe-fixes
5159
```
60+
**Must show 0 errors** before proceeding!
61+
62+
**Note**: CI runs `ruff check owlapy --line-length=200` (without `--fix`).
63+
Use `--fix --unsafe-fixes` locally to auto-fix issues before pushing.
5264

53-
2. ✅ Run full test suite (excluding EBR):
65+
3.**Run full test suite** (excluding EBR):
5466
```bash
5567
PYTHONPATH=. pytest --ignore=tests/test_z_do_last_ebr_retrieval.py -p no:warnings -x
5668
```
69+
**All tests must pass** before proceeding!
70+
71+
4.**Stage and commit changes** with descriptive message
5772

58-
3.Verify no test failures (especially JVM-related tests)
73+
5.**Push to feature branch**
5974

60-
4.Commit changes with descriptive message
75+
6.**Create pull request**
6176

62-
5. ✅ Push to feature branch
77+
### Quick Pre-Push Command
78+
```bash
79+
# Run both linter and tests in one line:
80+
conda activate temp_owlapy && ruff check owlapy --line-length=200 --fix --unsafe-fixes && PYTHONPATH=. pytest --ignore=tests/test_z_do_last_ebr_retrieval.py -p no:warnings -x
81+
```
6382

64-
6. ✅ Create pull request
83+
**Only push if BOTH succeed (0 errors, all tests pass)!**
6584

6685
### Known Test Issues
6786

owlapy/owl_ontology.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ def __eq__(self, other):
12701270
if isinstance(other, SyncOntology):
12711271
try:
12721272
return self.owlapi_ontology.getOntologyID().equals(other.owlapi_ontology.getOntologyID())
1273-
except:
1273+
except Exception:
12741274
# If JVM is not running, fall back to comparing IRI paths
12751275
return self.path == other.path
12761276
return False

0 commit comments

Comments
 (0)