Flakeheaven ignores baseline when using absolute path to file
See original GitHub issueflakeheaven lint filename.py
is clean because of baseline, but flakeheaven lint $(basename filename.py)
gives errors.
As a minimal example, save the following file as flake8heavened
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import sys
from flakeheaven import flake8_entrypoint
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(flake8_entrypoint())
Run flakeheaven baseline flake8helled >> .flakeheaven_baseline
Then flakeheaven lint flake8helled
is clean, but flakeheaven lint $(realpath flake8helled)
is not.
This is an issue because VS Code (and may be other IDEs) use the absolute path to the files.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10
Top Results From Across the Web
baseline for legacy projects · Issue #330 · PyCQA/flake8 · GitHub
flake8baseline to save all violations you already have into a json file. Then when you run your linter as flake8 --baseline=PATH all old...
Read more >flakeheaven - PyPI
flakeheaven is a python linter built around flake8 to enable inheritable and complex toml configuration. This project is a fork of FlakeHell. FlakeHell...
Read more >gitignore - Global Git Ignore with absolute path - Stack Overflow
First, it's worth mentioning a tricky bit about ignore file patterns: if they contain a leading or an embedded slash, they apply across ......
Read more >What problem is Flakeheaven solving? : r/learnpython - Reddit
Short answer: flakeheaven is a python linter. It works on top of flake8 and adds some extensions and customization: pyproject.toml support. per- ...
Read more >Path.GetFullPath Method (System.IO) - Microsoft Learn
The file or directory for which to obtain absolute path information. Returns. String. The fully qualified location of path , such as "C:\MyFile.txt"....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mcarans Thanks for merging in record time!
@mcarans I never used flakehell. I did try flakehell, but it was incompatible with flake8 4.0.0, discovered flakeheaven. The relevant code appears to be identical in flakehell.
I don’t think this is a bug, but a limitation of how the baseline is calculated. Currently, the filename is hashed as is, without considering whether it’s a relative or an absolute path. I wanted to check-in the baseline to git so we can share it across all developers. Since every developer will have a different abspath, it makes sense to use relative paths.
Unfortunately, VS Code (I haven’t checked other IDEs) uses absolute path to run the flake8 checks, which means the baseline file is ignored in the integration. Command-line works fine, of course.