FILE: ...tml/tolearn/modules/git/contentimport/src/Form/ContentImport.php
----------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 359 | ERROR | [x] Whitespace found at end of line
 432 | ERROR | [x] Line indented incorrectly; expected 18 spaces,
     |       |     found 4
 432 | ERROR | [x] Closing brace indented incorrectly; expected 18
     |       |     spaces, found 4
----------------------------------------------------------------------

Comments

deepanker_bhalla created an issue. See original summary.

deepanker_bhalla’s picture

Status: Needs work » Needs review
StatusFileSize
new25.75 KB

Fixed the issues.

deepanker_bhalla’s picture

StatusFileSize
new25.72 KB

I have found some more issues while checking it with latest version. Thus updating the patch with all the issues resolved.

msankhala’s picture

  1. diff --git a/Content_Import_Sample.csv b/Content_Import_Sample.csv
    deleted file mode 100644
    

    Why this file is being deleted?

  2. +++ b/README.txt
    @@ -60,8 +60,8 @@ langcode - By default it should be 'en' for english and
    -For Image field - upload all the images 
    -	in public://<content_type>/images/ folder before importing 
    +For Image field - upload all the images
    +	in public://<content_type>/images/ folder before importing
    

    This has unnecessary empty space.

  3. +++ b/README.txt
    @@ -77,8 +77,8 @@ For Entity Reference field(Content) - put the title of the node
    -For Boolean field - Put On/on/Yes/yes to check the field and Off/No to uncheck the 
    -	field.
    +For Boolean field - Put On/on/Yes/yes to check the field and Off/No to uncheck ¶
    +	the	field.
    
    @@ -86,6 +86,13 @@ For Date field - Put the data in m/d/Y h:m:i format or if you want the date only
    +For Geolocation field - Put the latitude and longitude values with , separated
    +	If the field having mulitple values, put the data with ; as delimiter
    +	Eg: lat1,long1
    +		lat2,long2;lat3,long3
    +		lat4,long4;lat5,long5;lat6,long6
    +		lat7,long7
    

    This has unnecessary empty space.

The patch #3 is modifying code way more than fixing the coding standard. Can you please check that you creating diff in the correct way?

msankhala’s picture

Status: Needs review » Needs work
gangwarsurya’s picture

Status: Needs work » Needs review
StatusFileSize
new991 bytes

Hi

Fixed the Coding standard issues.

msankhala’s picture

Status: Needs review » Needs work

@gangwarsurya Thanks for the work but there is still one warning which need to be fixed.

❯ contentimport 8.x-4.x* phpcs --standard=Drupal .

d8core/modules/contrib/contentimport/contentimport.routing.yml
-----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
 8 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------

Time: 465ms; Memory: 10Mb

Also, the patch should be created from within the contentimport module directory instead of from Drupal root directory.

gangwarsurya’s picture

StatusFileSize
new826 bytes

Hi
Updated patch within the contentimport module directory.

gangwarsurya’s picture

Status: Needs work » Needs review
msankhala’s picture

Status: Needs review » Needs work

@gangwarsurya The patch in comment #8 is the same one as the previous one in #6. You haven't modified anything in the patch. See the output:

❯ contentimport 8.x-4.x* git apply -v 3001463-coding-standard-7_0.patch
Checking patch src/Form/ContentImport.php...
warning: src/Form/ContentImport.php has type 100644, expected 100755
Applied patch src/Form/ContentImport.php cleanly.

❯ contentimport 8.x-4.x* phpcs --standard=Drupal .

FILE: modules/contrib/contentimport/contentimport.routing.yml
-----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
 8 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------

Time: 353ms; Memory: 10Mb
gangwarsurya’s picture

StatusFileSize
new115.82 KB

Hi
@msankhala I have checked with coder module after apply above patch. please see attached screenshot.

msankhala’s picture

Can you please check the version of the coder module and PHP Code Sniffer? I do have 3.3.1 version of PHP Code Sniffer and 8.3.0 version of coder module.

phpcs --version
PHP_CodeSniffer version 3.3.1 (stable) by Squiz (http://www.squiz.net)

Its a Drupal coding standard that each file should have a single newline at the end of the file.

gangwarsurya’s picture

StatusFileSize
new100.72 KB

Hi

I have 3.3.2 (stable) PHP Code Sniffer and 8.3.0 version of coder module.

msankhala’s picture

This is weird. How do you run PHPCS with Drupal coding standard against this module? Can you please confirm that this contentimport.routing.yml file has a single newline at the end of file?

As per coding standard guide:

All text files should end in a single newline (\n). This avoids the verbose "\ No newline at end of file" patch warning and makes patches easier to read since it's clearer what is being changed when lines are added to the end of a file.

See https://www.drupal.org/docs/develop/standards/coding-standards#indenting

deepanker_bhalla’s picture

Status: Needs work » Needs review
msankhala’s picture

Status: Needs review » Needs work

There are two things those need to be fixed after applying the patch #8.

1. Patch is changing the file permission from 755 to 644 of file src/Form/ContentImport.php

❯ contentimport 8.x-4.x* git apply 3001463-coding-standard-7_0.patch
warning: src/Form/ContentImport.php has type 100644, expected 100755

2. After applying the patch there is still one warning reported by PHPCS.

❯ contentimport 8.x-4.x* phpcs --standard=Drupal .

FILE: /Users/mutant/Sites/htdocs/d8core/modules/contrib/contentimport/contentimport.routing.yml
-----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
 8 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------

Time: 343ms; Memory: 10Mb
patelmayank7552’s picture

Status: Needs work » Needs review
StatusFileSize
new1.14 KB

Hi @msankhala,

I have fixed the coding standards for the module.

Please review it.

Attaching the patch file, please check it.

msankhala’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. Thanks @patelmayank7552 the patch #17 fixes the issue reported in#16.

dhayanandan_k’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in the latest version.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.