Replies: 2 comments 2 replies
-
Removing |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm getting a similar problem on my private repo. I am on ruff 0.0.282. I am gettting this particularly when converting our repo to use ruff isort versus isort. On a linux VM using x86 ruff passes, on a docker/macbook arm i it fails on a subset of files, in CI on ubuntu-latest which is x86 it fails on a large number of files that are different that the docker/macbook subset. Any ideas? select = [
"F401", # unused-import
"I", # isort
]
exclude = [
".git",
"__pycache__",
"gen-py",
]
line-length = 88
target-version = "py311" ruff:
runs-on: ubuntu-latest
steps:
- name: Check out Git repo
uses: actions/checkout@v3
- name: Run ruff
uses: chartboost/ruff-action@2bc585f1253832f5a5220d7fbf86976822116147
with:
src: "./src"
version: 0.0.282 |
Beta Was this translation helpful? Give feedback.
-
Maybe this is just a config issue across multiple tools and/or the CI platform, but I'm having trouble getting ruff running properly through pre-commit on Bitbucket Pipelines.
You can see this sample repository that I've setup on Bitbucket: https://bitbucket.org/zeshuaro/r0/src/master/
I have a very basic config for ruff:
And using a local hook for pre-commit:
I'm also using the sample Python code from the docs, where ruff should identify a couple of issues:
When running pre-commit locally via
pre-commit run --all-files
, everything works as expected:However, when running pre-commit on Bitbucket Pipelines, ruff doesn't identify any issues as shown here: https://bitbucket.org/zeshuaro/r0/pipelines/results/6
Based on the debugging logs, it seems like the Python file didn't get pick up because it was under the directory
/opt/atlassian/pipelines/agent/build
, which makes sense because ruff ignores thebuild
directory by default, I believe. And I confirmed with apwd
that the above directory is the working directory on Bitbucket Pipelines.I guess the easy workaround is to override the
exclude
config and not include thebuild
directory. But I don't want to do this because packaging produces thebuild
directory and I don't want ruff to run against it (specifically in the local environment I guess).So my question is what's the recommendation to configure ruff or the other tools in this case?
Beta Was this translation helpful? Give feedback.
All reactions