Skip to content

Commit

Permalink
Merge pull request #100 from leinardi/master
Browse files Browse the repository at this point in the history
Release 0.16.2
  • Loading branch information
leinardi authored Oct 16, 2023
2 parents f08771e + 0b86b1d commit 67ff688
Show file tree
Hide file tree
Showing 11 changed files with 215 additions and 141 deletions.
83 changes: 56 additions & 27 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,80 @@
**[0.16.2] 2023-10-16**

- Fix compatibility issues

**[0.16.1] 2023-10-09**

- Fix several compatibility issues

**[0.16.0] 2023-09-02**

- Possible fixe for #82: Pylint doesn't detect remote interpreter
- Possible fixe for #58: On Windows allow pylint to use pylint installed in WSL
- Respect Pylint path field and don't force usage of project interpreter

**[0.15.0] 2023-04-24**

- Fixed Icons not visible in new Jetbrains UI
- New: Min IDEA version raised from PC-2021.2 to PC-2022.1.4
- Several dependency updates

**[0.14.0] 2022-02-26**

- New: Improved executable auto-detection on Windows
- New: Make plugin hot-reloadable
- New: Show notification when PyLint exits abnormally
- Several dependency updates

**[0.13.1] 2021-12-06**

- New: Minimum compatibility version raised to 201.8743

**[0.13.0] 2021-12-05**
- Fixed #11: Stopping old instances of PyLint when requesting new ones (a huge thanks to @intgr for fixing this issue for [mypy-pycharm](https://github.com/leinardi/mypy-pycharm), making the port for this plugin trivial!)

- Fixed #11: Stopping old instances of PyLint when requesting new ones (a huge thanks to @intgr for fixing this issue
for [mypy-pycharm](https://github.com/leinardi/mypy-pycharm), making the port for this plugin trivial!)
- New: Min IDEA version raised from 2018 to PC-2021.2.3
- Several dependency updates

**[0.12.2] 2020-04-25**
- Fixed #61: Changed module/project icons to be compatible with EAPs of IDEA 2020.1

- Fixed #61: Changed module/project icons to be compatible with EAPs of IDEA 2020.1

**[0.12.1] 2020-02-04**
- Fixed regression generating several errors in Event Log during inspection


- Fixed regression generating several errors in Event Log during inspection

**[0.12.0] 2020-02-01**
- New: Min IDEA version raised from 2016 to 2018
- New: Tidied up deprecations in the 2018 SDK
- New: Fixed possible deadlock during inspection

- New: Min IDEA version raised from 2016 to 2018
- New: Tidied up deprecations in the 2018 SDK
- New: Fixed possible deadlock during inspection

**[0.11.2] 2020-02-01**
- Fix #42: no linting when using `--init-hook` in the parameter field

- Fix #42: no linting when using `--init-hook` in the parameter field

**[0.11.1] 2019-09-15**
- New: Improved error handling

- New: Improved error handling

**[0.11.0] 2019-01-02**
- PyLint real-time inspection disabled by default as numerous users find running it in the background has a negative
impact on their system performance
- Fix #29: Implementing a better virtualenv detection

- PyLint real-time inspection disabled by default as numerous users find running it in the background has a negative
impact on their system performance
- Fix #29: Implementing a better virtualenv detection

**[0.10.2] 2018-09-25**
- Fix #26: SyntaxError: Non-UTF-8 code starting with '\x90' when interpreter is set on Windows

- Fix #26: SyntaxError: Non-UTF-8 code starting with '\x90' when interpreter is set on Windows

**[0.10.1] 2018-09-21**
- Fix #22: PyLint absolute path not working on Windows
- Fix #24: PyLint auto-detection not working on Windows

- Fix #22: PyLint absolute path not working on Windows
- Fix #24: PyLint auto-detection not working on Windows

**[0.10.0] 2018-09-12**

- Fix #7: Support linting inside current Virtualenv
- Fix #19: Don't show the 'syntax-error' message for real-time scan
- New: Improved Pylint auto-detection
Expand All @@ -60,23 +83,29 @@
- New: Minimum compatibility version raised to 163.15529

**[0.9.0] 2018-09-04**
- Info: I am aware of the venv import error but for now I only have a partial solution. If you want to help or just get updates on the issue, click [here](https://github.com/leinardi/pylint-pycharm/issues/7).
- New: Showing better info to the user if Pylint is missing
- New: Added ability to optionally specify a pylintrc
- New: Added ability to optionally specify Pylint arguments

- Info: I am aware of the venv import error but for now I only have a partial solution. If you want to help or just get
updates on the issue, click [here](https://github.com/leinardi/pylint-pycharm/issues/7).
- New: Showing better info to the user if Pylint is missing
- New: Added ability to optionally specify a pylintrc
- New: Added ability to optionally specify Pylint arguments

**[0.8.0] 2018-09-01**
- New: Added missing type `info`
- New: Autoscroll to Source is disabled by default

- New: Added missing type `info`
- New: Autoscroll to Source is disabled by default

**[0.7.1] 2018-09-01**
- New: Project has moved to [https://github.com/leinardi/pylint-pycharm](https://github.com/leinardi/pylint-pycharm)

- New: Project has moved to [https://github.com/leinardi/pylint-pycharm](https://github.com/leinardi/pylint-pycharm)

**[0.7.0] 2018-08-31**
- New: Added Scan Files Before Checkin
- New: Added real-time scanning!
- New: UX based on Checkstyle-IDEA plugin.
- New: Plugin id and name changed (please remove manually the old plugin)

- New: Added Scan Files Before Checkin
- New: Added real-time scanning!
- New: UX based on Checkstyle-IDEA plugin.
- New: Plugin id and name changed (please remove manually the old plugin)

**[0.1.0]**
- Initial release.

- Initial release.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
version=0.16.0
version=0.16.2
ideVersion=PC-2022.1.4
pythonPlugin=python-ce
sinceBuild=221.6008
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/leinardi/pycharm/pylint/PylintPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public final class PylintPlugin {

private static final Logger LOG = com.intellij.openapi.diagnostic.Logger.getInstance(PylintPlugin.class);

private static final long NO_TIMEOUT = 0L;

private final Set<Future<?>> checksInProgress = new HashSet<>();
private final Project project;

Expand Down Expand Up @@ -141,7 +143,7 @@ public Map<PsiFile, List<Problem>> scanFiles(@NotNull final List<VirtualFile> fi
}

try {
return whenFinished(runAsyncCheck(new ScanFiles(this, files))).get();
return whenFinished(runAsyncCheck(new ScanFiles(this, files)), NO_TIMEOUT).get();
} catch (final Throwable e) {
LOG.warn("ERROR scanning files", e);
return Collections.emptyMap();
Expand Down
85 changes: 41 additions & 44 deletions src/main/java/com/leinardi/pycharm/pylint/checker/Problem.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
import com.intellij.psi.PsiElement;
import com.leinardi.pycharm.pylint.PylintBundle;
import com.leinardi.pycharm.pylint.plapi.SeverityLevel;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.jetbrains.annotations.NotNull;

import java.util.Objects;

public class Problem {
private final PsiElement target;
private final SeverityLevel severityLevel;
Expand Down Expand Up @@ -103,53 +102,51 @@ public boolean isSuppressErrors() {

@Override
public String toString() {
return new ToStringBuilder(this)
.append("target", target)
.append("message", message)
.append("messageId", messageId)
.append("severityLevel", severityLevel)
.append("line", line)
.append("column", column)
.append("symbol", symbol)
.append("afterEndOfLine", afterEndOfLine)
.append("suppressErrors", suppressErrors)
.toString();
}

@Override
public int hashCode() {
return new HashCodeBuilder()
.append(target)
.append(message)
.append(messageId)
.append(severityLevel)
.append(line)
.append(column)
.append(symbol)
.append(afterEndOfLine)
.append(suppressErrors)
.toHashCode();
return "Problem{" +
"target=" + target +
", severityLevel=" + severityLevel +
", line=" + line +
", column=" + column +
", symbol='" + symbol + '\'' +
", message='" + message + '\'' +
", messageId='" + messageId + '\'' +
", afterEndOfLine=" + afterEndOfLine +
", suppressErrors=" + suppressErrors +
'}';
}

@Override
public boolean equals(Object other) {
if (other == this) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(other instanceof Problem)) {
if (!(o instanceof Problem)) {
return false;
}
Problem rhs = ((Problem) other);
return new EqualsBuilder()
.append(target, rhs.target)
.append(message, rhs.message)
.append(messageId, rhs.messageId)
.append(severityLevel, rhs.severityLevel)
.append(line, rhs.line)
.append(column, rhs.column)
.append(symbol, rhs.symbol)
.append(afterEndOfLine, rhs.afterEndOfLine)
.append(suppressErrors, rhs.suppressErrors)
.isEquals();
Problem problem = (Problem) o;
return line == problem.line &&
column == problem.column &&
afterEndOfLine == problem.afterEndOfLine &&
suppressErrors == problem.suppressErrors &&
Objects.equals(target, problem.target) &&
severityLevel == problem.severityLevel &&
Objects.equals(symbol, problem.symbol) &&
Objects.equals(message, problem.message) &&
Objects.equals(messageId, problem.messageId);
}

@Override
public int hashCode() {
return Objects.hash(
target,
severityLevel,
line,
column,
symbol,
message,
messageId,
afterEndOfLine,
suppressErrors
);
}
}
72 changes: 29 additions & 43 deletions src/main/java/com/leinardi/pycharm/pylint/plapi/Issue.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@

package com.leinardi.pycharm.pylint.plapi;

import com.squareup.moshi.Json;

import java.util.Objects;

/**
* An issue as reported by the Pylint tool.
*/

import com.squareup.moshi.Json;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

public class Issue {

@Json(name = "type")
Expand Down Expand Up @@ -120,53 +118,41 @@ public void setMessageId(String messageId) {

@Override
public String toString() {
return new ToStringBuilder(this)
.append("type", severityLevel)
.append("module", module)
.append("obj", obj)
.append("line", line)
.append("column", column)
.append("path", path)
.append("symbol", symbol)
.append("message", message)
.append("messageId", messageId).toString();
return "Issue{" +
"severityLevel=" + severityLevel +
", module='" + module + '\'' +
", obj='" + obj + '\'' +
", line=" + line +
", column=" + column +
", path='" + path + '\'' +
", symbol='" + symbol + '\'' +
", message='" + message + '\'' +
", messageId='" + messageId + '\'' +
'}';
}

@Override
public int hashCode() {
return new HashCodeBuilder()
.append(message)
.append(module)
.append(symbol)
.append(path)
.append(column)
.append(line)
.append(obj)
.append(messageId)
.append(severityLevel)
.toHashCode();
return Objects.hash(severityLevel, module, obj, line, column, path, symbol, message, messageId);
}

@Override
public boolean equals(Object other) {
if (other == this) {
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(other instanceof Issue)) {
if (!(o instanceof Issue)) {
return false;
}
Issue rhs = ((Issue) other);
return new EqualsBuilder()
.append(message, rhs.message)
.append(module, rhs.module)
.append(symbol, rhs.symbol)
.append(path, rhs.path)
.append(column, rhs.column)
.append(line, rhs.line)
.append(obj, rhs.obj)
.append(messageId, rhs.messageId)
.append(severityLevel, rhs.severityLevel)
.isEquals();
Issue issue = (Issue) o;
return line == issue.line &&
column == issue.column &&
severityLevel == issue.severityLevel &&
Objects.equals(module, issue.module) &&
Objects.equals(obj, issue.obj) &&
Objects.equals(path, issue.path) &&
Objects.equals(symbol, issue.symbol) &&
Objects.equals(message, issue.message) &&
Objects.equals(messageId, issue.messageId);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.leinardi.pycharm.pylint.checker.Problem;
import com.leinardi.pycharm.pylint.exception.PylintToolException;
import com.leinardi.pycharm.pylint.plapi.SeverityLevel;
import com.leinardi.pycharm.pylint.util.Strings;
import org.jetbrains.annotations.Nullable;

import javax.swing.Box;
Expand Down Expand Up @@ -71,8 +72,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static org.apache.commons.lang.StringUtils.isBlank;

/**
* The tool window for Pylint scans.
*/
Expand Down Expand Up @@ -236,7 +235,7 @@ public void showToolWindow() {
* @param text the new progress text, or null to clear.
*/
public void setProgressText(@Nullable final String text) {
if (isBlank(text)) {
if (Strings.isBlank(text)) {
progressLabel.setText(" ");
} else {
progressLabel.setText(text);
Expand Down
Loading

0 comments on commit 67ff688

Please sign in to comment.