Skip to content

Commit

Permalink
refactor: uncomment severity 3 & remove unused variables (#7060)
Browse files Browse the repository at this point in the history
* refactor: adding perltidy to t/lang.t (#7044)

Implementing perltidy to t/lang.t , will have a merge conflict with PR
6085

* taxonomy: add new Polish translations (#7068)

* Polish translations of meat

* add additinal polish translations of popular ingredients

* taxonomy: Corrections to cheeses (#7065)

Update categories.txt

* refactor: adding perltidy to files (#7070)

Implementing perltidy to t/dataquality.t , t/dataqualityfood.t , t/export.t

* taxonomy: flaxseed fiber (#6945)

* Update ingredients.txt

* Update ingredients.txt

* Update ingredients.txt

* Update ingredients.txt

* Update ingredients.txt

* Update ingredients.txt

* Update ingredients.txt

* Update ingredients.txt

* Update ingredients.txt

* update taxonomy and tests

Co-authored-by: Stéphane Gigandet <stephane@openfoodfacts.org>

* docs: Add how-to for remote dev (Gitpod) (#7053)

* docs: Add how-to for remote dev (Gitpod)
* docs: Add references/badges for gitpod environments

* feat: Nutrient levels knowledge panels with facts and recommendations (#6980)

* feat: knowledge panels for nutrient levels #6947

* add quantity in nutrient panel title

* facts + recommendations for salt

* fixed conflict

* add info and recommendations for sugars, fat and saturated fat

* fix: fix vitamin b1 thiamin %DV  (#7072)

fix: fix vitamin b1 thiamin %DV #6882

* refactor: updating perl critic

Changing the perl critic config file to make it easier to pick and
choose what tests will run.

* feat: perlcritic unused variables check

* refactor: perlcritic github testing

* fetch depth

* add perlcritic

* better error message

* all errors

* allow ProductOpener::PerlStandards

* remove undef

* comment out severity 3

Commented outunused variable, severity 3 so that there are less merge
conflicts when implementing perltidy to files.

* refactor: dont look into .git directory

Making sure that perlcritic doesn't look into .git directory

* adding perlcritic to Makefile

* moving perlcritic to pull_request.yml

* default for perlcritic

* refactor: uncomment severity 3

* refactor: removing unused variables

Co-authored-by: Teiron <12804636+Teiron@users.noreply.github.com>
Co-authored-by: moon-rabbitOFF <34795011+moon-rabbitOFF@users.noreply.github.com>
Co-authored-by: Stéphane Gigandet <stephane@openfoodfacts.org>
Co-authored-by: Tushar <ditsuke@protonmail.com>
  • Loading branch information
5 people authored and alexgarel committed Jul 19, 2022
1 parent 540ba4f commit d563c0b
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 18 deletions.
2 changes: 1 addition & 1 deletion .perlcriticrc
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ equivalent_modules = ProductOpener::PerlStandards


# severity 3
#[Variables::ProhibitUnusedVariables]
[Variables::ProhibitUnusedVariables]
# /end severity 3
2 changes: 0 additions & 2 deletions cgi/minion_job_status.pl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@

ProductOpener::Display::init();

my $import_files_ref;

my $job_id = param("job_id");

my %data;
Expand Down
1 change: 0 additions & 1 deletion cgi/search.pl
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@

my %search_fields_labels = ();
my @tags_fields_options;
my @contains;

push(
@tags_fields_options,
Expand Down
5 changes: 0 additions & 5 deletions lib/ProductOpener/Display.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5209,8 +5209,6 @@ sub search_and_display_products($request_ref, $query_ref, $sort_by, $limit, $pag

for my $product_ref (@{$request_ref->{structured_response}{products}}) {
my $img_url;
my $img_w;
my $img_h;

my $code = $product_ref->{code};
my $img = display_image_thumb($product_ref, 'front');
Expand Down Expand Up @@ -6696,7 +6694,6 @@ sub display_page($request_ref) {

$log->debug("displaying page", { title => $title }) if $log->is_debug();

my $object_ref;
my $type;
my $id;

Expand Down Expand Up @@ -6909,7 +6906,6 @@ sub display_page($request_ref) {
my $image_banner = "";
my $link = lang("donate_link");
my $image;
my $utm;
my @banners = qw(independent personal research);
my $banner = $banners[time() % @banners];
$image = "/images/banners/donate/donate-banner.$banner.$lc.800x150.svg";
Expand Down Expand Up @@ -9296,7 +9292,6 @@ CSS
}
my @columns;
my @extra_row_columns;
my @ecological_impact_columns;

my $extra_row = 0; # Some rows will trigger an extra row (e.g. Salt adds Sodium)

Expand Down
2 changes: 0 additions & 2 deletions lib/ProductOpener/ForestFootprint.pm
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,6 @@ sub compute_footprints_of_ingredients($$$) {

foreach my $ingredient_ref (@$ingredients_ref) {

my $ingredient_origins_ref;

# If we are at the first level of the ingredients array,
# ingredients have a rank, except the sub-ingredients listed at the end
if ($ingredient_ref->{rank}) {
Expand Down
1 change: 0 additions & 1 deletion lib/ProductOpener/Ingredients.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5243,7 +5243,6 @@ sub extract_ingredients_classes_from_text($) {
}
}

my $with_sweeteners;

my %all_seen = (); # used to not tag "huile végétale" if we have seen "huile de palme" already

Expand Down
1 change: 0 additions & 1 deletion lib/ProductOpener/Tags.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2512,7 +2512,6 @@ sub get_taxonomy_tag_and_link_for_lang($$$) {
my $tagid = shift;

my $tag_lc;
my $tag_url;

if ($tagid =~ /^(\w\w):/) {
$tag_lc = $1;
Expand Down
1 change: 0 additions & 1 deletion scripts/obsolete/import_openfood_ch_name_translations.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,6 @@
#print $json;

my @modified_fields;
my @images_ids;

my $openfood_ref = decode_json($json);
my $openfood_id = $openfood_ref->{data}{id};
Expand Down
2 changes: 0 additions & 2 deletions scripts/run_cloud_vision_ocr.pl
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@

my $cloud_vision_response = $ua->request($request);

my $status;

if ($cloud_vision_response->is_success) {

$log->info("request to google cloud vision was successful") if $log->is_info();
Expand Down
1 change: 0 additions & 1 deletion scripts/tag_stores_magasins_u.pl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
my $modified = 0;

my @modified_fields;
my @images_ids;

my $code = $imported_product_ref->{"EAN PRINCIPAL"};

Expand Down
1 change: 0 additions & 1 deletion t/food.t
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ $product_ref = {};

my $value = "50.1";
my $modifier;
my $unit;
# test we have no modifier
normalize_nutriment_value_and_modifier(\$value, \$modifier);
is($value, "50.1");
Expand Down

0 comments on commit d563c0b

Please sign in to comment.