Skip to content

Conversation

@stimjannik
Copy link
Collaborator

@stimjannik stimjannik commented Oct 23, 2025

  • Add NAMESPACE-file-plugin
  • Add NAMESPACE information to dependencies -> should be it's own namespace context
  • create has and get functions for packages

}

export interface NAMESPACEFormat {
this: NamespaceInfo;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not use a keyword here :D

public readonly version = new SemVer('0.1.0');

public applies(file: PathLike): boolean {
return /^(NAMESPACE|NAMESPACE\.txt)$/i.test(file.toString().split(/[/\\]/).pop() ?? '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return /^(NAMESPACE|NAMESPACE\.txt)$/i.test(file.toString().split(/[/\\]/).pop() ?? '');
return /^(NAMESPACE(\.txt)?)$/i.test(file.toString().split(/[/\\]/).pop() ?? '');

additionally, maybe we outsource:

  1. the regex to a static member
  2. cry move the "give me filename" thing that we also use for the description plugin into a helper function

public process(_ctx: FlowrAnalyzerContext, file: FlowrFileProvider<string>): FlowrNamespaceFile {
const f = FlowrNamespaceFile.from(file, SpecialFileRole.Namespace);
// already load it here
f.content();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we do not want this here :P this should be also removed from the description wrapper i guess 🤣

loadsWithSideEffects: boolean;
}

export interface NAMESPACEFormat {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to have this as NamespaceFileFormat (similar to the info)

* @see {@link parseNAMESPACE} for details on the parsing logic.
*/
protected loadContent(): NAMESPACEFormat {
return parseNAMESPACE(this.wrapped);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly i would like lowercase here

Comment on lines +32 to +33
*
*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can these be removed?

Suggested change
*
*

loadsWithSideEffects: false,
};
}
result[pkg].loadsWithSideEffects = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does this work? :D - the side effects part is also something that probably has to come from an external source that is unrelated to the namespace plugin but setting it here feels fair

if(parts.length !== 2) {
continue;
}
const [pkg, _func] = parts;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you do not use _func just [pkg] should be fine

Comment on lines +29 to +39
S3method(as.character,expectation)
S3method(compare,character)
export(auto_test)
export(auto_test_package)
export(colourise)
export(context)
exportClasses(ListReporter)
exportClasses(MinimalReporter)
importFrom(methods,setRefClass)
useDynLib(testthat,duplicate_)
useDynLib(testthat,reassign_function)`));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice, but for this feature, just because it is important (because we want to mine a looot of packages soon), i would like to have maybe 5-6 more real-world tests if this is ok for you

Comment on lines +7 to +9



Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file also contains a lot of interesting spacing 😅

p1.addInfo(undefined, undefined, new Range('<= 2.3'));
p1.addInfo(undefined, undefined, new Range('>= 1.5'));
p1.addInfo(undefined, undefined, new Range('<= 2.2.5'));
p1.addInfo('package', undefined, undefined, new Range('>= 1.3'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again this should be an object with named properties, otherwise this will kill us in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants