-
Notifications
You must be signed in to change notification settings - Fork 31
[FIX]: Remove unused CSV files from vocab_csv/ #259
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
Comments
A script the find CSV files with no mentioned in the codebase: #!/bin/bash
# Run this script from the "code" directory.
CSV_DIR="vocab_csv"
csv_files=$(find "$CSV_DIR" -type f -name "*.csv")
unused_files=()
for csv_file in $csv_files; do
file_name=$(basename "$csv_file")
if ! grep --include="*.py" --include="*.sh" -r "$file_name" . > /dev/null; then
unused_files+=("$file_name")
fi
done
if [ ${#unused_files[@]} -eq 0 ]; then
echo "All .csv files in '$CSV_DIR' are mentioned in the codebase."
else
sorted_unused_files=($(printf "%s\n" "${unused_files[@]}" | sort))
echo "The following .csv files in '$CSV_DIR' are not mentioned in the codebase:"
for file in "${sorted_unused_files[@]}"; do
echo "$file"
done
echo
echo "From the list above, these files are empty or have only one line:"
for file in "${sorted_unused_files[@]}"; do
file_path="$CSV_DIR/$file"
if [ ! -s "$file_path" ] || [ $(wc -l < "$file_path") -le 1 ]; then
echo "$file"
fi
done
fi |
Hi @bact thanks - some of these files are present because they are part of DPV 1.0 or 2.0, therefore we usually keep them around in case fixes are needed or we want to see source of changed extensions. Some others are proposed work items, so they won't be included in the RDF/HTML generation scripts. Below I've made a note for how to resolve each file, but there is no issue with keeping them in the folder as they are helpful to look stuff up now and then. In the future, once we have resolved the proposed items, deleting all files in
|
In
code/vocab_csv
, there are a number of CSV files that have no mentioned in the RDF/HTML generation code.We like to keep (1) and may like to remove (2) to tidy up the codebase and avoid possible confusion.
Files need to be reviewed
Listed below are CSV files that have no mentioned in the RDF/HTML generation code, with notes:
legal*
files are likely to be replaced by other files and could be removedThe text was updated successfully, but these errors were encountered: