texqc 0.3.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rultor.yml +1 -0
- data/.simplecov +1 -1
- data/Gemfile +1 -1
- data/Rakefile +1 -1
- data/bin/texqc +29 -21
- data/features/cli.feature +13 -1
- data/features/step_definitions/steps.rb +1 -1
- data/features/support/env.rb +1 -1
- data/texqc.gemspec +3 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6417dba6502ed4e98ee381614ada43663890850be482dc3e7f4dc30b72b8d25
|
4
|
+
data.tar.gz: 36a4e4704d3f35c92a7ab5ae66ced90d33f83cf96bea35c2138aaf526ea70095
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b61800ce2230eb64d841be40bc6dcabc6eeb4359878c7225b16be4cb1539c5812f90493e190ca02b2b20838a3d15ad8289ec30198b7ae1483824cfa4601b6244
|
7
|
+
data.tar.gz: 6b2481529eb732483a68acf882a8311c15088658d6e5b04bed6a766e4a89f8f33b20fda47f08852baaa1e84fd3b9f9696b9d5d54a3d35fa0208f65d10f78a67b
|
data/.rultor.yml
CHANGED
data/.simplecov
CHANGED
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2020 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2020-2021 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2020 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2020-2021 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/bin/texqc
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
# Copyright (c) 2020 Yegor Bugayenko
|
4
|
+
# Copyright (c) 2020-2021 Yegor Bugayenko
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -21,7 +21,7 @@
|
|
21
21
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
22
|
# SOFTWARE.
|
23
23
|
|
24
|
-
VERSION = '0.
|
24
|
+
VERSION = '0.6.0'
|
25
25
|
|
26
26
|
STDOUT.sync = true
|
27
27
|
|
@@ -47,9 +47,10 @@ begin
|
|
47
47
|
log = Loog::REGULAR
|
48
48
|
begin
|
49
49
|
opts = Slop.parse(ARGV, strict: true, help: true) do |o|
|
50
|
-
o.banner = "Usage (#{VERSION}): texqc [options] file
|
50
|
+
o.banner = "Usage (#{VERSION}): texqc [options] file...
|
51
51
|
Options are:"
|
52
|
-
o.
|
52
|
+
o.bool '--dry', 'Don\'t fail the build on errors'
|
53
|
+
o.array '--ignore', 'Ignore given regexp'
|
53
54
|
o.bool '--version', 'Print current version' do
|
54
55
|
puts VERSION
|
55
56
|
exit
|
@@ -65,30 +66,37 @@ Options are:"
|
|
65
66
|
rescue Slop::Error => ex
|
66
67
|
raise ex.message
|
67
68
|
end
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
[
|
69
|
+
candidates = opts.arguments
|
70
|
+
candidates += Dir['*.tex'] if candidates.empty?
|
71
|
+
candidates.each do |doc|
|
72
|
+
if doc.end_with?('.tex')
|
73
|
+
log.info("File extention removed from #{doc.inspect}")
|
74
|
+
doc = doc.gsub(/\.tex$/, '')
|
75
|
+
end
|
76
|
+
f = "#{doc}.log"
|
77
|
+
e = Errors.new
|
78
|
+
matches = [
|
79
79
|
/^Underfull /,
|
80
80
|
/^Overfull /,
|
81
81
|
/^LaTeX Warning: /,
|
82
|
+
/^pdfTeX warning: /,
|
82
83
|
/^Class [a-zA-Z0-9\*]+ Warning: /,
|
83
84
|
/^Package [a-zA-Z0-9\*]+ Warning: /,
|
84
85
|
/^LaTeX Font Warning: /
|
85
|
-
]
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
86
|
+
]
|
87
|
+
File.readlines(f).each_with_index do |t, i|
|
88
|
+
matches.each do |p|
|
89
|
+
next unless p.match?(t)
|
90
|
+
next if opts[:ignore].any? { |re| /.*#{re}.*/.match?(t) }
|
91
|
+
e.report(i, t)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
unless e.count.zero?
|
95
|
+
log.info("#{e.count} LaTeX processing errors found in #{f.inspect}")
|
96
|
+
exit 1
|
97
|
+
end
|
98
|
+
log.info("No LaTeX processing errors found in #{f.inspect}")
|
90
99
|
end
|
91
|
-
log.info("No LaTeX processing errors found in #{f.inspect}")
|
92
100
|
rescue StandardError => ex
|
93
101
|
if opts[:verbose]
|
94
102
|
puts Backtrace.new(ex).to_s
|
data/features/cli.feature
CHANGED
@@ -15,7 +15,7 @@ Feature: Command Line Processing
|
|
15
15
|
\end{document}
|
16
16
|
"""
|
17
17
|
When I run bash with "pdflatex article.tex"
|
18
|
-
Then I run bin/texqc with "
|
18
|
+
Then I run bin/texqc with ""
|
19
19
|
Then Exit code is zero
|
20
20
|
And Stdout contains "No LaTeX processing errors found"
|
21
21
|
|
@@ -44,3 +44,15 @@ Feature: Command Line Processing
|
|
44
44
|
Then I run bin/texqc with "article.tex"
|
45
45
|
Then Exit code is not zero
|
46
46
|
And Stdout contains "1 LaTeX processing errors"
|
47
|
+
|
48
|
+
Scenario: Bad LaTeX log output checked with LaTeX warning, but ignored
|
49
|
+
Given I have a "article.tex" file with content:
|
50
|
+
"""
|
51
|
+
\documentclass{article}
|
52
|
+
\begin{document}
|
53
|
+
test\label{xxx}test\label{xxx}
|
54
|
+
\end{document}
|
55
|
+
"""
|
56
|
+
When I run bash with "pdflatex article.tex"
|
57
|
+
Then I run bin/texqc with "--ignore 'may have changed' article.tex"
|
58
|
+
Then Exit code is zero
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2020 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2020-2021 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/features/support/env.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2020 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2020-2021 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/texqc.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2020 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2020-2021 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.rubygems_version = '2.2'
|
33
33
|
s.required_ruby_version = '>= 2.3'
|
34
34
|
s.name = 'texqc'
|
35
|
-
s.version = '0.
|
35
|
+
s.version = '0.6.0'
|
36
36
|
s.license = 'MIT'
|
37
37
|
s.summary = 'Quality Control of Your LaTeX Build'
|
38
38
|
s.description = 'Run it after you compile your LaTeX document'
|
@@ -46,7 +46,7 @@ Gem::Specification.new do |s|
|
|
46
46
|
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
47
47
|
s.add_runtime_dependency 'backtrace', '~> 0.3'
|
48
48
|
s.add_runtime_dependency 'loog', '~> 0.2'
|
49
|
-
s.add_runtime_dependency 'slop', '~> 4.
|
49
|
+
s.add_runtime_dependency 'slop', '~> 4.8.2'
|
50
50
|
s.add_development_dependency 'codecov', '0.2.6'
|
51
51
|
s.add_development_dependency 'cucumber', '~> 1.3.17'
|
52
52
|
s.add_development_dependency 'rake', '12.3.3'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: texqc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backtrace
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 4.8.2
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 4.8.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: codecov
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: '0'
|
173
173
|
requirements: []
|
174
|
-
rubygems_version: 3.
|
174
|
+
rubygems_version: 3.1.2
|
175
175
|
signing_key:
|
176
176
|
specification_version: 2
|
177
177
|
summary: Quality Control of Your LaTeX Build
|