Skip to content

Commit

Permalink
Try adjusting how Codesniffing is done
Browse files Browse the repository at this point in the history
  • Loading branch information
dshanske committed Dec 27, 2024
1 parent 2cc4809 commit 6f853f3
Show file tree
Hide file tree
Showing 19 changed files with 466 additions and 8 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ jobs:
tools: composer:v2, cs2pr
- name: Install Composer dependencies for PHP
uses: "ramsey/composer-install@v2"
- name: Detect coding standard violations
run: composer lint
#- name: Detect coding standard violations
#run: composer lint
# Check the code-style consistency of the PHP files.
- name: Check PHP code style
id: phpcs
run: composer lint:wpcs -- --no-cache --report-full --report-checkstyle=./phpcs-report.xml
- name: Show PHPCS results in PR
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
run: cs2pr ./phpcs-report.xml

4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"scssphp/scssphp": "^1.13.0",
"civicrm/composer-downloads-plugin": "^4.0",
"simple-icons/simple-icons": "^14.0",
"wpreadme2markdown/wp2md": "^4.1"
"wpreadme2markdown/wp2md": "^4.1",
"akirk/extract-wp-hooks": "^1.0"
},
"prefer-stable" : true,
"scripts": {
Expand All @@ -79,6 +80,7 @@
"cp -u -r vendor/sokil/php-isocodes/databases/iso_3166-2/*.json data/iso_3166-2/",
"cp -u -r vendor/sokil/php-isocodes/databases/iso_3166-1.json data/"
],
"update-docs": "./vendor/bin/extract-wp-hooks.php",
"build-css": [
"vendor/bin/pscss --style=expanded sass/main.scss css/location.css",
"vendor/bin/pscss --style=compressed sass/main.scss css/location.min.css",
Expand Down
11 changes: 11 additions & 0 deletions extract-wp-hooks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"namespace": "Simple_Location",
"base_dir": ".",
"wiki_directory": "hook_docs",
"github_blob_url": "https://github.com/dshanske/simple-location/blob/main/",
"ignore_filter": [
"widget_title",
"wp_read_image_metadata_types",
"wp_date"
]
}
40 changes: 40 additions & 0 deletions hook_docs/Hooks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

## class-elevation-provider.php

- [`sloc_elevation_provider_defaults`](sloc_elevation_provider_defaults)

## class-geo-base.php

- [`simple_location_sidebox`](simple_location_sidebox)
- [`sloc_post_types`](sloc_post_types)

## class-geo-data.php

- [`simple_location_display_defaults`](simple_location_display_defaults) HTML type to wrap the entire location in
- [`sloc_geo_taxonomies`](sloc_geo_taxonomies)

## class-geo-provider.php

- [`location_display_name`](location_display_name)
- [`sloc_geo_provider_defaults`](sloc_geo_provider_defaults)

## class-loc-config.php

- [`default_sloc_aspect_ratios`](default_sloc_aspect_ratios)

## class-location-provider.php

- [`sloc_location_provider_defaults`](sloc_location_provider_defaults)

## class-post-venue.php

- [`pre_at_venue`](pre_at_venue) Short-circuits the checking for a venue if it is not stored as normal.
- [`pre_nearby_venue`](pre_nearby_venue) Short-circuits the checking for a venue if it is not stored as normal.

## class-venue-provider.php

- [`sloc_venue_provider_defaults`](sloc_venue_provider_defaults)

## class-weather-provider.php

- [`sloc_weather_provider_defaults`](sloc_weather_provider_defaults)
32 changes: 32 additions & 0 deletions hook_docs/default_sloc_aspect_ratios.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Auto-generated Example

```php
add_filter(
'default_sloc_aspect_ratios',
function ( array $string_list ) {
// Your code here
return $string_list;
}
);
```

## Parameters

- *`array`* `$string_list`

## Files

- [includes/class-loc-config.php:773](https://github.com/dshanske/simple-location/blob/main/includes/class-loc-config.php#L773)
```php
apply_filters(
'default_sloc_aspect_ratios',
array(
'1.77777777778' => __( 'Widescreen', 'simple-location' ),
'1' => __( 'Square', 'simple-location' ),
'1.333333333' => __( 'Medium Format', 'simple-location'
// ...
```



[Hooks](Hooks)
37 changes: 37 additions & 0 deletions hook_docs/location_display_name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## Auto-generated Example

```php
add_filter(
'location_display_name',
function (
$display_name,
$reverse
) {
// Your code here
return $display_name;
},
10,
2
);
```

## Parameters

- `$display_name` Other variable names: `$return`
- `$reverse`

## Files

- [includes/class-geo-provider.php:137](https://github.com/dshanske/simple-location/blob/main/includes/class-geo-provider.php#L137)
```php
apply_filters( 'location_display_name', $reverse['display_name'], $reverse )
```

- [includes/class-geo-provider.php:166](https://github.com/dshanske/simple-location/blob/main/includes/class-geo-provider.php#L166)
```php
apply_filters( 'location_display_name', $return, $reverse )
```



[Hooks](Hooks)
39 changes: 39 additions & 0 deletions hook_docs/pre_at_venue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

Short-circuits the checking for a venue if it is not stored as normal.

Default null.

## Auto-generated Example

```php
add_filter(
'pre_at_venue',
function (
Simple_Location\mixed $value,
Simple_Location\float $lat,
Simple_Location\float $lnt
) {
// Your code here
return $value;
},
10,
3
);
```

## Parameters

- *`Simple_Location\mixed`* `$value` The boolean value as to whether someone is at a venue.
- *`Simple_Location\float`* `$lat` Latitude.
- *`Simple_Location\float`* `$lnt` Longitude.

## Files

- [includes/class-post-venue.php:446](https://github.com/dshanske/simple-location/blob/main/includes/class-post-venue.php#L446)
```php
apply_filters( 'pre_at_venue', null, $lat, $lng )
```



[Hooks](Hooks)
41 changes: 41 additions & 0 deletions hook_docs/pre_nearby_venue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

Short-circuits the checking for a venue if it is not stored as normal.

Default null.

## Auto-generated Example

```php
add_filter(
'pre_nearby_venue',
function (
Simple_Location\mixed $value,
Simple_Location\float $lat,
Simple_Location\float $lnt,
int $radius
) {
// Your code here
return $value;
},
10,
4
);
```

## Parameters

- *`Simple_Location\mixed`* `$value` The boolean value as to whether someone is at a venue.
- *`Simple_Location\float`* `$lat` Latitude.
- *`Simple_Location\float`* `$lnt` Longitude.
- *`int`* `$radius` Radius.

## Files

- [includes/class-post-venue.php:377](https://github.com/dshanske/simple-location/blob/main/includes/class-post-venue.php#L377)
```php
apply_filters( 'pre_nearby_venue', null, $lat, $lng, $radius )
```



[Hooks](Hooks)
29 changes: 29 additions & 0 deletions hook_docs/simple_location_display_defaults.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

HTML type to wrap the entire location in

## Auto-generated Example

```php
add_filter(
'simple_location_display_defaults',
function ( $defaults ) {
// Your code here
return $defaults;
}
);
```

## Parameters

- `$defaults`

## Files

- [includes/class-geo-data.php:989](https://github.com/dshanske/simple-location/blob/main/includes/class-geo-data.php#L989)
```php
apply_filters( 'simple_location_display_defaults', $defaults )
```



[Hooks](Hooks)
33 changes: 33 additions & 0 deletions hook_docs/simple_location_sidebox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Auto-generated Example

```php
add_action(
'simple_location_sidebox',
function (
$current_screen,
$object,
$args
) {
// Your code here
},
10,
3
);
```

## Parameters

- `$current_screen`
- `$object`
- `$args`

## Files

- [includes/class-geo-base.php:119](https://github.com/dshanske/simple-location/blob/main/includes/class-geo-base.php#L119)
```php
do_action( 'simple_location_sidebox', get_current_screen(), $object, $args )
```



[Hooks](Hooks)
26 changes: 26 additions & 0 deletions hook_docs/sloc_elevation_provider_defaults.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Auto-generated Example

```php
add_filter(
'sloc_elevation_provider_defaults',
function ( $defaults ) {
// Your code here
return $defaults;
}
);
```

## Parameters

- `$defaults`

## Files

- [includes/class-elevation-provider.php:37](https://github.com/dshanske/simple-location/blob/main/includes/class-elevation-provider.php#L37)
```php
apply_filters( 'sloc_elevation_provider_defaults', $defaults )
```



[Hooks](Hooks)
31 changes: 31 additions & 0 deletions hook_docs/sloc_geo_provider_defaults.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Auto-generated Example

```php
add_filter(
'sloc_geo_provider_defaults',
function ( $defaults ) {
// Your code here
return $defaults;
}
);
```

## Parameters

- `$defaults`

## Files

- [includes/class-geo-provider.php:72](https://github.com/dshanske/simple-location/blob/main/includes/class-geo-provider.php#L72)
```php
apply_filters( 'sloc_geo_provider_defaults', $defaults )
```

- [includes/class-map-provider.php:136](https://github.com/dshanske/simple-location/blob/main/includes/class-map-provider.php#L136)
```php
apply_filters( 'sloc_geo_provider_defaults', $defaults )
```



[Hooks](Hooks)
26 changes: 26 additions & 0 deletions hook_docs/sloc_geo_taxonomies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Auto-generated Example

```php
add_filter(
'sloc_geo_taxonomies',
function ( array $string_list ) {
// Your code here
return $string_list;
}
);
```

## Parameters

- *`array`* `$string_list`

## Files

- [includes/class-geo-data.php:634](https://github.com/dshanske/simple-location/blob/main/includes/class-geo-data.php#L634)
```php
apply_filters( 'sloc_geo_taxonomies', array( 'venue' ) )
```



[Hooks](Hooks)
Loading

0 comments on commit 6f853f3

Please sign in to comment.