Skip to content
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

Skip indexing of generated files #1255

Merged
merged 12 commits into from
Mar 25, 2022
Merged

Conversation

robertoaloi
Copy link
Member

No description provided.

For now the mechanism only supports files tagged as generated via their header. This mechanism can later be expanded based on interest (eg via regex, application, size, etc)
apps/els_core/src/els_config_indexing.erl Outdated Show resolved Hide resolved
Comment on lines 53 to 55
SkipGeneratedFiles = els_config_indexing:get_skip_generated_files(),
GeneratedFilesTag = els_config_indexing:get_generated_files_tag(),
try_index_file(Path, 'deep', SkipGeneratedFiles, GeneratedFilesTag),
Copy link
Contributor

Choose a reason for hiding this comment

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

The two values are always passed in together - should they be made into just one accessor? Something like:

els_config_indexing:skip_generated_config()

which would return disabled | {enabled, Tag}

It should simplify the code and follow the "make impossible states unrepresentable" approach

Copy link
Member Author

Choose a reason for hiding this comment

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

I like this a lot, but let's do this as a follow up. The main reason is that the whole config management needs refactoring, so it would be nice to come up with a common pattern.

@robertoaloi robertoaloi force-pushed the skip-indexing-of-generated-files branch from 2ed1070 to 0c34080 Compare March 25, 2022 11:26
@robertoaloi robertoaloi merged commit 9eed7d4 into main Mar 25, 2022
@robertoaloi robertoaloi deleted the skip-indexing-of-generated-files branch March 25, 2022 13:50
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.

2 participants