Jump to content

Elliot Hillary

Members
  • Content Count

    15
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Elliot Hillary


  1. 10 hours ago, Die Holländer said:

    It seems that I can only analyze my *.dpr file, which contains very little code.

    How do I analyse other Delphi *.pas files?

    When selected then "Analyse this file" is grayed out..

    Hi @Die Holländer, I'm glad that fixing your Java path resolved the problem!

     

    DelphiLint has the concept of a "project directory", which is basically the root directory of the analysis - files outside the project directory cannot be analyzed.

    There is a relevant FAQ section here describing how to change the default project directory.

    In your case, I'm guessing the *.pas files are in a different directory to your *.dpr? Changing the project directory to a common parent directory will allow you to analyze all your project files.

     

    14 hours ago, zed said:

    After a successful installation, the first time you use DelphiLint it wants to have Internet access to get something from GitHub. Why didn't the installer provide all the staff DelphiLint needed?

     

    NRCmL6dsxP.png

    Hi @zed,DelphiLint downloads the SonarDelphi analyzer in the background, since it uses it internally. You can configure exactly which version you want, which is why DelphiLint does it, not the installer.
    That being said, I suppose the installer could download the default version for you so that you can use it fully offline immediately if you choose. Thanks for the suggestion!

     

    8 hours ago, corneliusdavid said:

    After reading some of the other posts here about Java 11, I breezed through the installation for both D11 and D12, opened a small project, made sure several units were open in the IDE, and selected Analyze All Open Files. I like how the suggestions are brightly highlighted right in the IDE--many good suggestions. This is pretty slick!

     

    I thought at first it only analyzed the current file but as soon as I switched to a different file in the IDE, the Delphi Lint window updated with the different list of suggestions for that file.  Double slick!!

    Hi @corneliusdavid, really glad to hear that you're enjoying DelphiLint! This release has a number of user experience improvements that are undoubtedly contributing to that ever-important slick factor. :classic_biggrin:


  2. Hi @Die Holländer, @Torbjörn,

     

    DelphiLint is not trying to contact an external server, it is trying and failing to start the backend analyzer process (the "DelphiLint server").

    I would recommend having a read of the FAQ, particularly the section titled DelphiLint fails, saying that the server failed to communicate the port. It is usually caused by using an older Java version than DelphiLint's minimum requirement (Java 11).

     

    6 minutes ago, Torbjörn said:

    I had the same issue in the previous version, so I had hoped that it would have been fixed in this new version.

    If you ever have a problem, please raise an issue! We can only test so many device configurations and DelphiLint has no telemetry, so we rely on user reports to let us know what to fix.


  3. delphilint-title-light.png.846c571c12e0030493da87e6d2162248.png

    We're excited to release version 1.1.0 of DelphiLint, a free and open-source static analyzer and linter for the Delphi IDE!

     

    DelphiLint is powered by SonarDelphi, our Delphi analyzer for the SonarQube code quality platform, and can be run in two modes:

    • Standalone - run analyses entirely locally, no server required

    • Connected - connect to a SonarQube server, allowing for synchronization with the server's quality profiles and configuration

     

    Release: https://github.com/integrated-application-development/delphilint/releases/latest

    Blog Post: https://github.com/integrated-application-development/delphilint/discussions/43

     

    New Features in 1.1.0

    • Quick fixes - fix issues using suggested automatic changes
    • Standalone rule configuration - configure the analysis rules that are applied in Standalone Mode
    • Declutter files by hiding issues
    • Many performance improvements and bug fixes

     

    For more details, see the blog post for release 1.1.0 and the repository README.

    • Like 9

  4. Please raise an issue on the DelphiLint repository if you encounter a problem. As I've said, we're not actively monitoring this page - I only noticed this post by coincidence - so I can't guarantee your issue will be fixed if it's only discussed here.

     

    The JAVA_HOME environment variable should be set along with your JRE installation. If it's not, then (as you say) DelphiLint prompts you for the location of a Java executable, which is indeed java.exe. Setting this to the java.exe in your JRE folder and clicking "Apply this configuration" should work correctly - if this does not work, please raise an issue with a description of the problems this is causing.

     

    I'm not sure exactly how a change to startup code could improve on this experience, or how the guidance can be improved. Please feel free to raise an issue or pull request suggesting improvements to these!


  5. On 3/30/2024 at 6:46 AM, JonRobertson said:

    For anyone that has DelphiLint installed, I just filed ticket Issue 20 because BDS.exe was racing one logical CPU when the IDE was otherwise idle and no projects were loaded. Once I removed the Delphi Lint package, BDS.exe CPU usage dropped to 0%.

    Thanks for submitting an issue, it was only a small fix - an unoptimized background thread was wasting CPU cycles waiting for the server to start.

    This issue is resolved in DelphiLint 1.0.2, along with a couple of other minor improvements.


  6. 6 hours ago, JonRobertson said:

    I definitely would appreciate customizing rules in standalone mode. I attempted installing SonarQube and going the "connected mode" route. However, I had difficulty getting the SonarQube service started and I am not a Java guy.

     

    Some of the rules are more annoying than helpful. I have no idea what "naming conventions" DelphiLint is expecting. One convention seems to be that unit names must be PascalCase. Particularly for legacy projects, there is no benefit. Yes, a consistent naming convention is very helpful. Does anyone care that all of our form units follow formMain.pas rather than FormMain.pas? 

     

    I almost want to create an issue for the rule "split this 128 characters long line (which is greater than 120 authorized)". Authorized by who, or what? Certainly not by me, my employer, or anything that I've configured in Delphi. 

      

    Others are personal preferences. "Delphi style guides" may advise against using () when calling a routine without arguments. But I prefer to have them. They do no harm and I think they improve code read-ability.

     

    Those are just a couple examples where the ability to customize the rules, even in standalone mode, would be appreciated.

    Sorry to hear you had issues starting up SonarQube - is it possible that the root cause is the same as #8? This part of the SonarQube documentation could be helpful.

     

    By default, DelphiLint and SonarDelphi follow Delphi's Object Pascal Style Guide, so this is where the naming convention rules get their standard opinions from.
    Standalone rule customization is a highly requested feature - we're tracking the proposal as #16 and are looking to add it in a future release.


  7. 1 hour ago, tgbs said:

    How to uninstall

    To uninstall from your IDE, you remove it like any other package through Components > Install Packages. If you’d like to totally remove all traces of DelphiLint from your system, deleting the folder %APPDATA%\DelphiLint will do the trick. 

     

    Although, if you’re uninstalling because you want to install a newer version of DelphiLint instead, there’s no need to do any of this - the install script automatically uninstalls any old versions.

    • Like 2

  8. 8 hours ago, VoSs2o0o said:

    Thank you for your fast support, it is working now! Also this is a very impessive Tool. 

    I will next try it with the SC-Server to have more control over the rules. It will be a Standardtool for me, when i make it to add/remove/tweak some rules...

    Anyway it is still helpful in the Offline-Configuration.

    Great to see that your problem is resolved and you're finding DelphiLint helpful!

     

    We're tracking features and bugs using the GitHub Issues for integrated-application-development/delphilint, so please let us know there if you encounter any problems in the future 🙂


  9. 57 minutes ago, JonRobertson said:

    Thanks for the extra info. Downloaded and renamed. The first unit that I tried to analyze gave this error...

    Sorry to hear that.

    DelphiLint (and SonarDelphi) have been successfully used with much larger codebases than you describe - I suspect this could be a JVM issue.

    Please raise an issue, including your JDK/JRE distribution and version, and we'll see what we can do!


  10. 4 hours ago, JonRobertson said:

    I am curious what the "standalone" version would download from GitHub. Following the link to install SonarDelphi, you need to install SonarQube, then SonarScanner, then install the SonarDelphi plug-in in SonarQube. 

     

    I installed SonarQube and configured a database via the install instructions. But the SonarQube service refuses to start.

    As Zane says, DelphiLint just downloads the SonarDelphi plugin jar from a GitHub release (here) - internally, it runs the plugin as if it was running within SonarScanner.

    Please note that if you choose to manually download the jar and place it in %APPDATA%\DelphiLint\plugins, it should be named "DEFAULT-sonar-delphi-plugin-1.3.0.jar".


  11. 11 hours ago, Stefan Glienke said:

    Is it still not possible to create self-contained executables with Java? If so it would be nice because that would remove the requirement for the JRE.

    While it is possible, it has a number of downsides. It's not an avenue we're pursuing at the moment since installing the JRE is pretty quick and easy.


  12. 4 minutes ago, tgbs said:

    I just tried it and it works. But I didn't see where I could remove the check for mixed names for example. And how to remove the texts from the file without closing Delphi

    Thanks for trying it out - glad it went smoothly for you!

     

    Currently you cannot customise the list of rules used in standalone mode.

    In connected mode, you can configure the rules to use on SonarQube - the relevant section of the SonarDelphi manual is here.

    If there's a lot of interest in customising the rules in standalone mode, that's certainly something that could make its way into a future release.


    There's also currently no way of "clearing" issues from a file after an analysis.

    Of course, if you fix the issues and re-analyze the file, they will disappear, but if this is something you'd like to see as well then please let us know.

     

    We're tracking feature requests and bugs using GitHub Issues - please raise an issue for any features you'd like to see (and of course, for any bugs you encounter)!
    Contributions are also welcome :)

    • Like 1

  13. 37 minutes ago, Der schöne Günther said:

    I have a stupid question about

     

    Does that mean it runs entirely self-dependent, and I do not need a license for SonarQube?

    That's correct - you don't need to have anything SonarQube-related to use DelphiLint in standalone mode. After installing into the IDE, it's ready to go.

     

    If you decide you would like to set up SonarQube and use DelphiLint in connected mode, it's worth mentioning that SonarQube Community Edition is free, open-source, self-hosted, and does not require any sort of license - with the SonarDelphi plugin it's a great (and free) option for managing Delphi code quality.

    • Like 1

  14. image.png.5303cf8eab4a7e11b7806aff5154884e.png

    We're excited to announce the release of DelphiLint v1.0.0, a free and open-source static analyzer and linter for the Delphi IDE!

     

    DelphiLint is powered by SonarDelphi, our Delphi analyzer for the SonarQube code quality platform that scans entire codebases with more than 120 different rules.
    With DelphiLint, the feedback loop is shortened - it allows you to analyze individual files within your editor and correct problems before they're even checked in.

     

    GitHub: https://github.com/integrated-application-development/delphilint

    Release: https://github.com/integrated-application-development/delphilint/releases/tag/v1.0.0

     

    Features

    • Analyze one or more files on demand
    • View detected issues, descriptions, and rationale inline in the Delphi IDE
    • Two analysis modes:
      • Standalone - run analyses entirely locally with a default set of active rules
      • Connected - connect to a SonarQube instance, allowing for
        • Fetching of active rules and configuration from the server's configured quality profiles
        • Suppression of issues that have been resolved in past analyses
        • Usage of the server's version of SonarDelphi
    • Uses the same rules and configuration files as SonarDelphi, making configuration easy for projects that already use SonarDelphi for code quality

     

    DelphiLint supports RAD Studio for Delphi 11+.

    Feedback and contributions are welcome!

    • Like 17
    • Thanks 1
×