-
-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Roslynator linter #3155
Add Roslynator linter #3155
Conversation
🦙 MegaLinter status: ❌ ERROR
See detailed report in MegaLinter reports |
@nvuillam do you know what problem I may have here: megalinter/megalinter/utilstest.py Line 634 in f680b93
What causes it not to filter files that it should? Thank you! |
@bdovaz maybe your updates in utils_test.py ? |
Either you didn't understand me or I didn't explain well. I know that the problem is in that file but what I mean is that I have changed that instead of using a custom code I use the method: utils.filter_files But there is some input that I am passing it wrong because it returns files that it should not as I have put in the second link. As I imagine that you created that method that's why I ask you if you saw at a glance something wrong. Thanks! |
@bdovaz I built it a long time ago, I'm afraid you'll need a breakpoint ^^ |
@nvuillam and how do I mount the setup locally? Because since Gitpod was added the instructions have changed and following these steps: https://megalinter.io/latest/contributing/#42-desktop I find that it tells me that it can't find the "redis" module and I can't run the tests as I could before in VS Code following these steps: https://megalinter.io/latest/contributing/#execute-the-tests-locally-visual-studio-code |
It's because it needs a version of python greater than 3.11.3, like 3.11.4. A package made a hotfix and conditionally imported a package a different way on older versions, but their fix doesn't work properly. But what python is available in the Ubuntu repositories is too old. I need to add the requirements for adding a PPA, and add the https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa ppa then reinstall python3.11. But it never works on first try, and I need to fix a broken installation each time. So I'm not sure how it's supposed to be. |
@echoix thank you very much, updating to the latest 3.11.x fixed it for me. How do you know it was that? The error didn't say anything other than it couldn't find the "redis" module. My experience with python and its tooling is quite limited 🤣 |
I don't remember exactly, but I followed the imports and read the code, and searched on google in parallel. I saw the offending code. I found the specific issue on github the other month, but lost track of it. |
@nvuillam ready for you to review! The builds that fail are because of the same thing: Complaining about a file that evidently does not yet exist in the main branch. |
@bdovaz thanks for this great addition 😍😍 |
Fixes #2269
Proposed Changes
Dotnet restore command:
In the end I put it in the "process_linter" method because it is the only one I see that I could do it in.
Related to tests:
I had to add 2 specific variables to the descriptors for the format_fix test.
You may ask, why?
Well, because this linter takes as input ".csproj" files but when doing format/fix it actually modifies the ".cs" files which are the scripts contained in the project (.csproj).
The value that I have put to each variable is the following:
dotnet restore
previously, it generates the folders /bin, /obj and these folders do not have to be taken into account.Besides in this test I have simplified the file filtering logic and I have used the "core"
utils.filter_files
method to avoid duplicated and error prone logic