(Sorry I already written this info in other posts)
We tried to make a customizable linter with Flinter, but we lack feedback. If some motivated guy want to try it out, the help (and critics) would be appreciated.
Note : To make this possible we extended Lizard to Fortran , so we have a new free Cyclomatic Complexity evaluation by func/subroutine for fortran tooβ¦
I just gave it a quick try. It deserves to be tested! The installation is so easy: $ pip install flinter
I guess I should customize the options because I donβt βagreeβ with all default formatting rules. But I have found some interesting things in the Fortran code I tested, for example:
The flint tree is interesting. Is it possible to make the image bigger? (itβs rather small compared to current resolutionsβ¦) And the standard color scale is strange: OK, it follows the rainbow order, but green for high score would be more intuitive I think.
Thanks for that work, I will try to test it further.
yeah, The string (and docstring) is somehow biasing the results. I hope we will find a clean solution soon.
Do tell me more about the rules you would prefer to see as a default (This probably the hardest part, finding a common linting standardβ¦)
I agree the graphical output should be more customisable. We tried to follow Paul Tol rules to be colorblind friendly. The βIncandescentβ scale might be a better fit.
I think flinter would deserve its own thread in the Discourse, rather than discussing in βFortran goals for 2022β.
Concerning the default formatting rules, maybe a poll in the Discourse could help defining them.
Concerning colors, I am not familiar with colorblind friendly but βincandescentβ scale could be more intuitive. For me, green means βeverything is OKβ!
β― git clone https://github.com/tblite/tblite
β― cd tblite
β― fpm update
β― git clone . build/dependencies/tblite
β― time flint score build/dependencies
Flinter global rating -->|3.90|<-- (150571 statements)
flint score build/dependencies 17.55s user 0.07s system 99% cpu 17.635 total
The tree view is really helpful for spotting files worth linting. The overall result looks quite well, since Iβm not actually following the built-in style Iβm loosing some score points there, especially for files with many comments, due to one-space-after-comment at the moment (!> Docstring style).
Personally, I would deactivate that one because I generally put a space after ! when writing a sentence but not when using a comment as a delimiter like:
Yes, we could for example expect a space if it begins with an alphanumeric character.
I think itβs important to define general rules that are accepted by a majority of people. If the user feels there are two many false positive warnings (from his point of view), he may finally not use flinter (the user may be too lazy to define its own rules).
I will have a play with it during the weekend and get back to you. From the looks of it there might be some potential collaboration with our VS Code Modern Fortran extension.
I would be keen on learning more about the underlying parser(s) that you are using, maybe we can start another thread about this.
@Dauptain Observation: Flinter/flint hosted on GitLab is not flint as hosted on GitHub; though, once installed, actually both launch by $ flint [parameters] easy to recall (analogue to e.g., pylint for Python).*
Question: Is there an intent to join the forces on what looks like a partially overlapping target of hint the user to the line better revised while the provision of the maps by flint(GitLab) obviously advance much further?
*) Iβm aware setting an alias in .bashrc may remove the ambiguity between the two.
I agree, the homonym btw github and gitlab is a mistake from us. All apologies @marshallward . Story is as usual, we started a project, got a minimal satisfied user base in the lab, then decided to put the stuff open source. We forgot the check on github. I will add disclaimers and redirection ASAP in the README.
When we will have some new manpower on this, I plan to divide instead 1) Try to contribute directly to Flint(Github) if we are up to the task 2) and specialize FLint>Gitlab into FlintMap, extending it with some visual greps, mapping of complexities, etcβ¦
However, Manpower in France is scarce this year , the ETA of this division is expected for 2023.
No need to apologize, Iβm glad to hear about this project. And I think we can all agree that PyPI could use better namespacing .
Although the internals are rather different, I think there are a lot of common goals here. Letβs stay in touch and see how things evolve once we both have the resources to come back to these respective projects.
True, homonyms one may encounter in business (Merck/Germany vs. Merck & Co in the U.S.; though actually a split [fork] for political reasons), or in computation. Like OpenBabel for the transformation of chemical data which faced a similar situation when transitioning to Python 3:
# OB 2.x
import openbabel as ob
import pybel
# OB 3.0
from openbabel import openbabel as ob
from openbabel import pybel
Β« While more verbose, the new arrangement is in line with standard practice and helps avoid conflict with a different Python project, PyBEL. Β»
with pyBEL as in Biological Expression Language about handling biological networks e.g., in epigenetics (reference). Or of course the many Β«babelΒ» outside CTAN β including Babel of OpenBabel itself β¦
Or perhaps issue a note when attempting to deposit a new project in tune of Β«there already is a project of identical/similar enough name on PyPi and GitHub, GitLab, Gitea, BitBucket, β¦ Β».
Note that I have not modified the trailing-whitespaces rule. And the regex seems OK : ([ \t])+$. If I remove the two spaces at the beginning of the third line, no trailing spaces are found.