Skip to content

chore: drop unnecessary # -*- coding: utf-8 -*- declarations (ruff UP009)#151

Open
alexzhu0 wants to merge 1 commit into
FlowElement-ai:mainfrom
alexzhu0:chore/ruff-up009-drop-utf8-coding-decl
Open

chore: drop unnecessary # -*- coding: utf-8 -*- declarations (ruff UP009)#151
alexzhu0 wants to merge 1 commit into
FlowElement-ai:mainfrom
alexzhu0:chore/ruff-up009-drop-utf8-coding-decl

Conversation

@alexzhu0
Copy link
Copy Markdown
Contributor

@alexzhu0 alexzhu0 commented May 2, 2026

Summary

Ruff rule UP009 flags explicit # -*- coding: utf-8 -*- declarations as unnecessary — UTF-8 is the default source encoding in Python 3 (PEP 3120), so the comment is purely decorative. 6 occurrences, all auto-fixable.

Each change is a single-line deletion of the coding declaration on line 2. The #!/usr/bin/env python shebang on line 1 is left in place.

 #!/usr/bin/env python
-# -*- coding: utf-8 -*-
 """
 English tokenization and mention extraction ...
 """

Files

Area Files
Coreference modules coreference/coreference_module/syntax_adapter.py, coreference/english_coreference/{coreference,ner_adapter,tokenizer}.py
Smoke test examples examples/episodic_stage5_smoke_test.py, examples/episodic_stage5_v2_smoke_test.py

6 files, −6 lines.

Verification

$ ruff check . --exclude 'm_flow/baml_client' --exclude 'm_flow-frontend' --select UP009
All checks passed!

$ for f in <every modified file>; do python -m py_compile "$f"; done
# clean across all 6 files

No behavior change. Generated code under m_flow/baml_client/ is untouched.

I affirm that all code in every commit of this pull request conforms to the terms of the M-flow Developer Certificate of Origin

…UP009)

UTF-8 is the default source encoding in Python 3 (PEP 3120), so these
`# -*- coding: utf-8 -*-` comments are now purely decorative. Ruff flags
them as UP009.

Scope: 6 files (4 under `coreference/`, 2 smoke-test examples).
Each diff is a single-line deletion of the coding declaration on line 2;
the `#!/usr/bin/env python` shebang on line 1 is left in place.

Verification:
- `ruff check . --exclude 'm_flow/baml_client' --select UP009` is now clean
- `py_compile` on every touched file: clean

No behavior change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant