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

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

Copy link
Member

Choose a reason for hiding this comment

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

This is still open!

*/
readonly config: FlowrConfigOptions;

readonly functions: ReadOnlyFlowrAnalyzerFunctionsContext;
Copy link
Member

Choose a reason for hiding this comment

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

Please add a doc comment

this.files = new FlowrAnalyzerFilesContext(loadingOrder, (plugins.get(PluginType.ProjectDiscovery) ?? []) as FlowrAnalyzerProjectDiscoveryPlugin[],
(plugins.get(PluginType.FileLoad) ?? []) as FlowrAnalyzerFilePlugin[]);
this.deps = new FlowrAnalyzerDependenciesContext(this, (plugins.get(PluginType.DependencyIdentification) ?? []) as FlowrAnalyzerPackageVersionsPlugin[]);
this.functions = new FlowrAnalyzerFunctionsContext(this, (plugins.get(PluginType.DependencyIdentification) ?? []) as FlowrAnalyzerPackageVersionsPlugin[]);
Copy link
Member

Choose a reason for hiding this comment

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

The functions context should not directly rely on the package versions, but maybe be a child of the analyzer dependencies context similar to the loading order

FlowrAnalyzerPackageVersionsPlugin
} from '../plugins/package-version-plugins/flowr-analyzer-package-versions-plugin';

export enum FunctionTypes {
Copy link
Member

Choose a reason for hiding this comment

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

it is weird to have a function type symbol, maybe rename this to ExportTypes

export interface ReadOnlyFlowrAnalyzerFunctionsContext {
readonly name: string;

getFunctionInfo(name: string, className?: string): FunctionInfo | undefined;
Copy link
Member

Choose a reason for hiding this comment

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

the function info must be scoped by the package namespace!

public addFunctionInfo(functionInfo: FunctionInfo) {
const fi = this.functionInfo.get(functionInfo.name);
if(fi) {
// merge?
Copy link
Member

Choose a reason for hiding this comment

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

Yes, and at least warn


public getFunctionInfo(name: string, className?: string): FunctionInfo | undefined {
if(className) {
return this.functionInfo.get(`${name}.${className}`);
Copy link
Member

Choose a reason for hiding this comment

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

not what i expected with className maybe s3TypeDispatch?

import { FlowrNamespaceFile } from './flowr-namespace-file';
import { platformBasename } from '../../../dataflow/internal/process/functions/call/built-in/built-in-source';

const NamespaceFilePattern = /^(NAMESPACE(\.txt)?)$/i;
Copy link
Member

Choose a reason for hiding this comment

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

I dont think we need the outer parens

}

/**
*
Copy link
Member

Choose a reason for hiding this comment

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

could you please fill in these?

process(ctx: FlowrAnalyzerContext): void {
const nmspcFiles = ctx.files.getFilesByRole(FileRole.Namespace);
if(nmspcFiles.length !== 1) {
descriptionFileLog.warn(`Supporting only exactly one NAMESPACE file, found ${nmspcFiles.length}`);
Copy link
Member

Choose a reason for hiding this comment

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

do we? why? namespace files can be merged, we just have to throw errors if things are incompatible, but we have to that as well if it happens in the same namespace file

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.

This is still open!

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