-
Notifications
You must be signed in to change notification settings - Fork 76
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
Allow writing a single test case which will scan the current classpath for all @Immutable classes #44
Comments
Assigned to Daniel, see here: https://groups.google.com/d/msg/mutability-detector/M_qWYxGKkWo/_Me0UkRGuwMJ |
Well its been a while as I've been settling into my new job and teaching basic TDD. I now have a need for this and will start looking into a solution |
Sounds like a good plan! Looking forward to your participation. On Mon, Jul 7, 2014 at 9:01 PM, sandeater notifications@github.com wrote:
|
That is a very interesting issue. I know nothing about class scanning but I'm interested in giving this a try. Is that OK? |
@lasombra absolutely! I know nothing about classpath scanning either, so hopefully we can learn together 😄 This entire issue may be a bit big as it's currently described. So I think a good contribution to get started would be a change to Mutability Detector where a method was available, which, when invoked, scanned the classpath and lists all the classes it finds annotated with I see you're on the LJC's Slack. Feel free to ping me there for any questions you have in getting the project checked out, built. I don't know your level of familiarity with Java/Maven/Git etc, but no question is too basic! |
…wrote ClassPathScanner and its test.
* origin/master: Initial work on MutabilityDetector#44. # Conflicts: # src/main/java/org/mutabilitydetector/classpath/ClassPathScanner.java
Is this issue resolved yet ? if there is any work remaining around this and no one can pick up, please let me know. I could look into it |
This feature isn't available yet, no. Still work to be done. IIRC the first
steps have been taken to lookup classes (using reflection which isn't how
I'd like it but that's another topic, it'll do for now). Then there's work
to create the API for setting it up then executing all the tests.
Plenty to do would be great if you're interested!
…On Sat, 23 Mar 2019, 09:05 Sanket Band, ***@***.***> wrote:
Is this issue resolved yet ? if there is any work remaining around this
and no one can pick up, please let me know. I could look into it
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#44 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAcLq9gl5pEYWJXVJgS6vkM9D2mvAEViks5vZe5hgaJpZM4A8N1G>
.
|
ok, cool. For scanning the classes should we look at this open source project https://github.com/classgraph/classgraph ? it is compatible with Java 9 as well. |
My ideal solution would:
@sband with that as a rough guidance, I'll let you investigate and make a judgement call on whether classgraph is suitable or not. How does that sound? |
Awesome ! Most of the requirements you mentioned are addressed in classgraph. Here is the link for reference - https://github.com/classgraph/classgraph/wiki/How-fast-is-ClassGraph%3F I think i am asking too much, but would it be possible for you to explain the other part of this problem in more detail, i.e. creation of API so that i could proceed accordingly. An example would be more useful. |
Is this issue still open? If yes I'd like to start looking into this! Please let me know. |
@ShreyasKudari yes, still open. We don't have this functionality yet and I still believe it would be a fantastic feature. Let me know how I can help you get started. Feel free to issue small pull requests / fixes to get into the flow of committing. You don't have to have everything finished and perfect before contributing. I'd actually encourage the opposite, small, iterative improvements if you can. Thank you for your interest and don't hesitate to reach out. |
Got it. I will study this over the weekend and update you if I need something clarified. |
What do you think about integrating with ArchUnit? I think it would be way more flexible and you don't have to worry about classpath scanning. |
ArchUnit looks great! I wonder if Mutability Detector should wrap it, or
just make sure we can be used with it...
Are you affiliated to ArchUnit in any way, can you say more about how we
could integrate with it?
…On Wed, 24 Feb 2021, 22:45 Erik Hofer, ***@***.***> wrote:
What do you think about integrating with ArchUnit? I think it would be way
more flexible and you don't have to worry about classpath scanning.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#44 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADQXK2PZFQ4ZBOKITZUG23TAV6Q5ANCNFSM4AHQ3VDA>
.
|
@Grundlefleck I'm neither affiliated nor an expert. I think you should not wrap it but provide an Probably would look something like
where |
Currently, if you want to start using Mutability Detector on your project, and you already have a lot of classes marked as
@Immutable
, you can either:I would like to find a solution which offers the best of both worlds: to be able to quickly check all your immutable classes, but which still allows flexible configuration for suppressing false positives.
Currently I think we could do something where:
@Immutable
classes and analyses them, reporting errors from all classesThis could possibly use a library like http://scannotation.sourceforge.net/ or something similar, to do the scanning. I don't know yet how this method could exclude classes which are being tested elsewhere. Perhaps we would need to get creative.
The text was updated successfully, but these errors were encountered: