Results 1 to 8 of 8

Thread: Patching KoLmafia for non devs

  1. #1
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,797

    Default Patching KoLmafia for non devs

    A request was made to create and maintain a sticky thread explaining the patch process for non-devs.

    The process is actually quite simple.

    • Write and test a patch.
    • Post the patch file on kolmafia.us.
    • Wait for a dev to submit the patch for you.


    A successful submit requires social and technical skills.

    The set of social skills includes the ability to get along with devs at the KoLmafia.us community. Users that have managed to alienate themselves from members of the dev team tend to have their proposed patches ignored.

    The ability to determine the appropriateness of a patch and the level of support for it is extremely useful. A patch that violates the spirit of KoLmafia (for example, that allows access to non-KoLmafia directories in the user's file system) will be rejected. A patch that changes an existing feature would need some discussion. A patch that changes a lot of code to implement a feature of at best niche interest is unlikely to be accepted.

    The technical skills are the ability to write and test Java code that works in the context of KoLmafia. A prerequisite for success is the ability to read and understand KoLmafia's code and infer its archetecture since those are not well documented in the traditional sense.

    Some existing links that may bear on this are:



    Note that the contents of some of these links may be out of date but perhaps an effort to use them will result in updates :-)

    Individuals with a good track record of creating and submitting patches can ask to be made a dev. The active devs who can do this are veracity0 and lostcalpolydude.

    This post is a beginning in hopes that it will attract useful information and eventually become one stop documentation.

    To the extent that opinions are expressed, they are all my personal opinions and I reserve the right to change them if someone thinks I am wrong :-)
    Well, thank you.
    Originally Posted by Veracity View Post

  2. #2
    Senior Member
    Join Date
    Apr 2019
    Posts
    260

    Default

    Is Eclipse mandatory to debug your own code without compiling? I kept getting an error about not having "org.eclipse.ui.ide.multiFilter" (using VScode)

    P.s., some of the paths in .classpath were pointing to old version of the files I had (like lib/jar/trilead-ssh2-1.0.0-build219.jar instead of lib/jar/trilead-ssh2-1.0.0-build222.jar). Is it a file that doesn't get updated when running TortoiseSVN, or is .classpath something you need to correct locally?
    Last edited by fredg1; 09-01-2020 at 02:13 AM. Reason: adding what IDE I'm using instead of Eclipse

  3. #3
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,797

    Default

    Eclipse is a preference, not a requirement. I have never used it seriously. I used NetBeans until I had a job where the commercial version of IntelliJ was the standard and I switched to the free version for KoLmafia.

    .classpath is one of the managed svn files. I believe it is irrelevant unless your IDE is Eclipse. AFAIK nothing in my environment is paying attention to it.

    I'm not sure what to make of your error other than observe that it seems as if your environment is not configured properly. I can imagine an import process where VSCode thought it was importing a complete Eclipse project. Checking in IDE specific files isn't always the best thing to do if the dev team isn't striving for a homogeneous environment across the team. I would investigate import settings and see if you can tell VSCode to create a new "project" from the mafia source instead of trying to import a project.

  4. #4
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,584

    Default

    Nice start fronobulax. I especially like that you documented the social skills required. Submitting a patch is much like submitting a bug report and people often fail to say to include all the right details. One thing I think you missed is coding style. Patches that don't match KoLmafia's existing coding style are nearly always rejected.

  5. #5
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,797

    Default

    Nice start fronobulax. I especially like that you documented the social skills required. Submitting a patch is much like submitting a bug report and people often fail to say to include all the right details. One thing I think you missed is coding style. Patches that don't match KoLmafia's existing coding style are nearly always rejected.
    Originally Posted by Crowther View Post
    Thank you. I avoided coding style because first and foremost I get it wrong myself when going from memory and haven't looked it up again. Since patches will be reviewed I personally don't mind correcting style issues that I notice and getting chided for the ones I miss. But I should write that up.

    The social skills I think are key.
    Well, thank you.
    Originally Posted by Veracity View Post

  6. #6
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,584

    Default

    Thank you. I avoided coding style because first and foremost I get it wrong myself when going from memory and haven't looked it up again.
    Originally Posted by fronobulax View Post
    I always just copy whatever style is already in the file I'm editing. At this point in my life it is just a reflex. You are right different devs have different preferences.

  7. #7
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    13,537

    Default

    Is Eclipse mandatory to debug your own code without compiling?
    Originally Posted by fredg1 View Post
    I don't know. I don't use an IDE to debug KoLmafia code. I do have Eclipse and IntelliJ installed (the latter because I used it in my last job, before I retired, about 6 months ago, I still have not done everything needed to make it work like I'd like to, since,as I said, my personal debugging style for this project has never required an IDE.)

    I do know that I have always had to update some classpaths - like the current SDE I am using - no matter which IDE I use. I needed that at my final job, too, whenever I updated the SDE on my system.

    I can't speak to TortoiseSVN. I use the "svn" command from my commandline - and the "java" command from my command line - to maintain my project and execute .jar files.

    If we check in a new version of the library, one would hope that it would appear and be used in your IDE's workspace. I am inclined to blame your IDE, rather than TortoiseSVN (which I do not use, since that is a Windows thing), for failing to use things which are, literally, sitting in your workspace.

    The "build.xml" ant file is the Source of Truth regarding what is needed to build KoLmafia. Eclipse and IntelliJ Idea are able to do that. Perhaps VScode is not?
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  8. #8
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    13,537

    Default

    I always just copy whatever style is already in the file I'm editing. At this point in my life it is just a reflex. You are right different devs have different preferences.
    Originally Posted by Crowther View Post
    I do this too.

    My personal style is not like KoLmafia's (I like to cuddle blocks inside a function, for example) and do not like the style that is enforced at other places I have worked (I hate cuddling the block on a function definition, and not putting whitespace in function calls makes it vastly harder to read, for example.)

    But, there is a "style" for KoLmafia, and I always write to it here - and will "correct" non-compliant code when I have cause to edit it.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •