csvlint 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/push.yml +22 -1
- data/.gitignore +2 -0
- data/.standard_todo.yml +0 -6
- data/Appraisals +22 -0
- data/csvlint.gemspec +2 -1
- data/features/support/load_tests.rb +4 -4
- data/gemfiles/activesupport_5.2.gemfile +7 -0
- data/gemfiles/activesupport_6.0.gemfile +7 -0
- data/gemfiles/activesupport_6.1.gemfile +7 -0
- data/gemfiles/activesupport_7.0.gemfile +7 -0
- data/gemfiles/activesupport_7.1.gemfile +7 -0
- data/lib/csvlint/cli.rb +2 -2
- data/lib/csvlint/version.rb +1 -1
- data/lib/csvlint.rb +1 -3
- metadata +26 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d15e75580e44bba3f1f8965b348f0ccfe088c6fb60e881b9f997c99fc05a7cc
|
4
|
+
data.tar.gz: 0bdf3cbec5a855f68abec7c2dccaa4f90db70955459044f7cfc67cbec963f9b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c86225f94173f87c44bd337975b3716c9b1ec629aa6d784e4b309724655d2af5eaa118fda1d1f139f0d6a432cfeb1536e7076603a2a4b0e94fe18278d28dcb9
|
7
|
+
data.tar.gz: 4986940f1b2d928d85ae65b01a8c2c3eede4f352218a5ad18aa761a153fcd0a1530189e418a1e38aa4c0544c998f19944a8de290ef924d6f539d959fa2dcca8f
|
data/.github/workflows/push.yml
CHANGED
@@ -5,12 +5,32 @@ on:
|
|
5
5
|
pull_request:
|
6
6
|
branches: [ main ]
|
7
7
|
jobs:
|
8
|
-
|
8
|
+
appraisal:
|
9
|
+
name: Ruby ${{ matrix.ruby-version }} / Rails ${{ matrix.activesupport-version }}
|
9
10
|
runs-on: ubuntu-latest
|
10
11
|
strategy:
|
11
12
|
matrix:
|
12
13
|
ruby-version: ['2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3']
|
14
|
+
activesupport-version:
|
15
|
+
- activesupport_5.2
|
16
|
+
- activesupport_6.0
|
17
|
+
- activesupport_6.1
|
18
|
+
- activesupport_7.0
|
19
|
+
- activesupport_7.1
|
20
|
+
exclude:
|
21
|
+
- ruby-version: '2.5'
|
22
|
+
activesupport-version: activesupport_7.0
|
23
|
+
- ruby-version: '2.6'
|
24
|
+
activesupport-version: activesupport_7.0
|
25
|
+
- ruby-version: '2.5'
|
26
|
+
activesupport-version: activesupport_7.1
|
27
|
+
- ruby-version: '2.6'
|
28
|
+
activesupport-version: activesupport_7.1
|
13
29
|
fail-fast: false
|
30
|
+
|
31
|
+
env:
|
32
|
+
BUNDLE_GEMFILE: gemfiles/${{ matrix.activesupport-version }}.gemfile
|
33
|
+
|
14
34
|
steps:
|
15
35
|
- uses: actions/checkout@v4
|
16
36
|
- uses: ruby/setup-ruby@v1
|
@@ -21,6 +41,7 @@ jobs:
|
|
21
41
|
run: bundle install
|
22
42
|
- name: Run the tests
|
23
43
|
run: bundle exec rake
|
44
|
+
|
24
45
|
lint:
|
25
46
|
runs-on: ubuntu-latest
|
26
47
|
steps:
|
data/.gitignore
CHANGED
data/.standard_todo.yml
CHANGED
@@ -2,14 +2,8 @@
|
|
2
2
|
# Remove from this list as you refactor files.
|
3
3
|
---
|
4
4
|
ignore:
|
5
|
-
- features/step_definitions/validation_errors_steps.rb:
|
6
|
-
- Lint/Void
|
7
5
|
- features/support/load_tests.rb:
|
8
|
-
- Style/For
|
9
6
|
- Security/Open
|
10
|
-
- Lint/UselessAssignment
|
11
|
-
- lib/csvlint/cli.rb:
|
12
|
-
- Style/NonNilCheck
|
13
7
|
- lib/csvlint/csvw/column.rb:
|
14
8
|
- Style/TernaryParentheses
|
15
9
|
- lib/csvlint/csvw/date_format.rb:
|
data/Appraisals
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# After a new entry: `bundle exec appraisal install`
|
2
|
+
# Add an entry in `.github/workflows/push.yml`'s file
|
3
|
+
|
4
|
+
appraise "activesupport_5.2" do
|
5
|
+
gem "activesupport", "~> 5.2.0"
|
6
|
+
end
|
7
|
+
|
8
|
+
appraise "activesupport_6.0" do
|
9
|
+
gem "activesupport", "~> 6.0.0"
|
10
|
+
end
|
11
|
+
|
12
|
+
appraise "activesupport_6.1" do
|
13
|
+
gem "activesupport", "~> 6.1.0"
|
14
|
+
end
|
15
|
+
|
16
|
+
appraise "activesupport_7.0" do
|
17
|
+
gem "activesupport", "~> 7.0.0"
|
18
|
+
end
|
19
|
+
|
20
|
+
appraise "activesupport_7.1" do
|
21
|
+
gem "activesupport", "~> 7.1.0"
|
22
|
+
end
|
data/csvlint.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency "csv"
|
22
22
|
spec.add_dependency "rainbow"
|
23
23
|
spec.add_dependency "open_uri_redirections"
|
24
|
-
spec.add_dependency "activesupport"
|
24
|
+
spec.add_dependency "activesupport"
|
25
25
|
spec.add_dependency "addressable"
|
26
26
|
spec.add_dependency "typhoeus"
|
27
27
|
spec.add_dependency "escape_utils"
|
@@ -48,4 +48,5 @@ Gem::Specification.new do |spec|
|
|
48
48
|
spec.add_development_dependency "rdf-turtle"
|
49
49
|
spec.add_development_dependency "henry"
|
50
50
|
spec.add_development_dependency "standardrb"
|
51
|
+
spec.add_development_dependency "appraisal"
|
51
52
|
end
|
@@ -16,7 +16,7 @@ def cache_file(filename)
|
|
16
16
|
unless File.exist?(file)
|
17
17
|
if filename.include? "/"
|
18
18
|
levels = filename.split("/")[0..-2]
|
19
|
-
|
19
|
+
(0..levels.length).each do |i|
|
20
20
|
dir = File.join(BASE_PATH, levels[0..i].join("/"))
|
21
21
|
Dir.mkdir(dir) unless Dir.exist?(dir)
|
22
22
|
end
|
@@ -26,7 +26,7 @@ def cache_file(filename)
|
|
26
26
|
f.puts URI.open(uri, "rb").read
|
27
27
|
end
|
28
28
|
end
|
29
|
-
|
29
|
+
uri
|
30
30
|
end
|
31
31
|
|
32
32
|
unless File.exist? SCRIPT_FILE_PATH
|
@@ -66,7 +66,7 @@ unless File.exist? VALIDATION_FEATURE_FILE_PATH
|
|
66
66
|
file.puts ""
|
67
67
|
|
68
68
|
manifest["entries"].each do |entry|
|
69
|
-
action_uri
|
69
|
+
action_uri = cache_file(entry["action"])
|
70
70
|
metadata = nil
|
71
71
|
provided_files = []
|
72
72
|
missing_files = []
|
@@ -98,7 +98,7 @@ unless File.exist? VALIDATION_FEATURE_FILE_PATH
|
|
98
98
|
missing_files << URI.join(action_uri, "csv-metadata.json").to_s
|
99
99
|
end
|
100
100
|
entry["implicit"]&.each do |implicit|
|
101
|
-
implicit_uri
|
101
|
+
implicit_uri = cache_file(implicit)
|
102
102
|
provided_files << implicit_uri.to_s
|
103
103
|
unless implicit_uri == metadata
|
104
104
|
file.puts "\t\tAnd I have a file called \"csvw/#{implicit}\" at the url \"#{implicit_uri}\""
|
data/lib/csvlint/cli.rb
CHANGED
@@ -105,7 +105,7 @@ module Csvlint
|
|
105
105
|
end
|
106
106
|
output_string = "#{index + 1}. "
|
107
107
|
if error.column && @schema && @schema.instance_of?(Csvlint::Schema)
|
108
|
-
|
108
|
+
unless @schema.fields[error.column - 1].nil?
|
109
109
|
output_string += "#{@schema.fields[error.column - 1].name}: "
|
110
110
|
end
|
111
111
|
end
|
@@ -176,7 +176,7 @@ module Csvlint
|
|
176
176
|
col: error.column
|
177
177
|
}
|
178
178
|
|
179
|
-
if error.column && @schema && @schema.instance_of?(Csvlint::Schema) &&
|
179
|
+
if error.column && @schema && @schema.instance_of?(Csvlint::Schema) && !@schema.fields[error.column - 1].nil?
|
180
180
|
field = @schema.fields[error.column - 1]
|
181
181
|
h[:header] = field.name
|
182
182
|
h[:constraints] = field.constraints.map { |k, v| [k.underscore, v] }.to_h
|
data/lib/csvlint/version.rb
CHANGED
data/lib/csvlint.rb
CHANGED
@@ -4,9 +4,7 @@ require "open-uri"
|
|
4
4
|
require "tempfile"
|
5
5
|
require "typhoeus"
|
6
6
|
|
7
|
-
require "active_support
|
8
|
-
require "active_support/core_ext/time/conversions"
|
9
|
-
require "active_support/core_ext/object"
|
7
|
+
require "active_support"
|
10
8
|
require "open_uri_redirections"
|
11
9
|
require "uri_template"
|
12
10
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csvlint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pezholio
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: csv
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: activesupport
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: addressable
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -416,6 +416,20 @@ dependencies:
|
|
416
416
|
- - ">="
|
417
417
|
- !ruby/object:Gem::Version
|
418
418
|
version: '0'
|
419
|
+
- !ruby/object:Gem::Dependency
|
420
|
+
name: appraisal
|
421
|
+
requirement: !ruby/object:Gem::Requirement
|
422
|
+
requirements:
|
423
|
+
- - ">="
|
424
|
+
- !ruby/object:Gem::Version
|
425
|
+
version: '0'
|
426
|
+
type: :development
|
427
|
+
prerelease: false
|
428
|
+
version_requirements: !ruby/object:Gem::Requirement
|
429
|
+
requirements:
|
430
|
+
- - ">="
|
431
|
+
- !ruby/object:Gem::Version
|
432
|
+
version: '0'
|
419
433
|
description: CSV Validator
|
420
434
|
email:
|
421
435
|
- pezholio@gmail.com
|
@@ -435,6 +449,7 @@ files:
|
|
435
449
|
- ".pre-commit-hooks.yaml"
|
436
450
|
- ".ruby-version"
|
437
451
|
- ".standard_todo.yml"
|
452
|
+
- Appraisals
|
438
453
|
- CHANGELOG.md
|
439
454
|
- CODE_OF_CONDUCT.md
|
440
455
|
- CONTRIBUTING.md
|
@@ -488,6 +503,11 @@ files:
|
|
488
503
|
- features/validation_errors.feature
|
489
504
|
- features/validation_info.feature
|
490
505
|
- features/validation_warnings.feature
|
506
|
+
- gemfiles/activesupport_5.2.gemfile
|
507
|
+
- gemfiles/activesupport_6.0.gemfile
|
508
|
+
- gemfiles/activesupport_6.1.gemfile
|
509
|
+
- gemfiles/activesupport_7.0.gemfile
|
510
|
+
- gemfiles/activesupport_7.1.gemfile
|
491
511
|
- lib/csvlint.rb
|
492
512
|
- lib/csvlint/cli.rb
|
493
513
|
- lib/csvlint/csvw/column.rb
|